mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-26 21:13:13 +00:00
async put
This commit is contained in:
@ -48,7 +48,7 @@ namespace Esiur.Stores.MongoDB
|
||||
IMongoDatabase database;
|
||||
IMongoCollection<BsonDocument> resourcesCollection;
|
||||
|
||||
Dictionary<string, WeakReference> resources = new Dictionary<string, WeakReference>();
|
||||
KeyList<string, WeakReference> resources = new KeyList<string, WeakReference>();
|
||||
|
||||
|
||||
[Public]
|
||||
@ -158,7 +158,8 @@ namespace Esiur.Stores.MongoDB
|
||||
else
|
||||
resources.Add(id, new WeakReference(resource));
|
||||
|
||||
Warehouse.Put(resource, document["name"].AsString, this);
|
||||
//@TODO this causes store.put to be invoked, need fix
|
||||
await Warehouse.Put(resource, document["name"].AsString, this);
|
||||
|
||||
|
||||
var parents = document["parents"].AsBsonArray;
|
||||
|
@ -36,9 +36,9 @@ namespace Esiur.Stores.MongoDB
|
||||
public class MongoDBStore<T> : MongoDBStore where T:IResource
|
||||
{
|
||||
[Public]
|
||||
public T New(string name = null, object properties = null)
|
||||
public async AsyncReply<T> New(string name = null, object properties = null)
|
||||
{
|
||||
var resource = Warehouse.New<T>(name, this, null, null, null, properties);
|
||||
var resource = await Warehouse.New<T>(name, this, null, null, null, properties);
|
||||
resource.Instance.Managers.AddRange(this.Instance.Managers.ToArray());
|
||||
return resource;
|
||||
}
|
||||
|
Reference in New Issue
Block a user