diff --git a/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj b/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj
index 58dc39b..29b678e 100644
--- a/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj
+++ b/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj
@@ -11,7 +11,7 @@
http://www.esyur.com
https://github.com/esyur/esyur-dotnet/
True
- 1.3.0
+ 1.3.2
diff --git a/Esyur.Stores.MongoDB/MongoDBStore.cs b/Esyur.Stores.MongoDB/MongoDBStore.cs
index 8aa940a..54d9a31 100644
--- a/Esyur.Stores.MongoDB/MongoDBStore.cs
+++ b/Esyur.Stores.MongoDB/MongoDBStore.cs
@@ -24,7 +24,6 @@ namespace Esyur.Stores.MongoDB
IMongoDatabase database;
IMongoCollection resourcesCollection;
-
Dictionary resources = new Dictionary();
@@ -52,6 +51,13 @@ namespace Esyur.Stores.MongoDB
}
+ /*
+ public IResource[] Query(string json)
+ {
+ //var json = "{ SendId: 4, 'Events.Code' : { $all : [2], $nin : [3] } }";
+ resourcesCollection.Find(new QueryDocument(BsonDocument.Parse(json)));
+
+ }*/
public bool Record(IResource resource, string propertyName, object value, ulong age, DateTime date)
{
@@ -98,29 +104,27 @@ namespace Esyur.Stores.MongoDB
return true;
}
-
-
- AsyncReply Fetch(string id) where T : IResource
+ async AsyncReply Fetch(string id) where T : IResource
{
if (resources.ContainsKey(id) && resources[id].IsAlive)
{
if (resources[id].Target is T)
- return new AsyncReply((T)resources[id].Target);
+ return (T)resources[id].Target;// new AsyncReply((T)resources[id].Target);
else
- return new AsyncReply(default(T)); ;
+ return default(T);// new AsyncReply(default(T)); ;
}
var filter = Builders.Filter.Eq("_id", new BsonObjectId(new ObjectId(id)));
var list = resourcesCollection.Find(filter).ToList();
if (list.Count == 0)
- return new AsyncReply(default(T));
+ return default(T);// new AsyncReply(default(T));
var document = list[0];
var type = Type.GetType(document["classname"].AsString);
if (type == null)
- return new AsyncReply(default(T));
+ return default(T);// new AsyncReply(default(T));
IResource resource = (IResource)Activator.CreateInstance(ResourceProxy.GetProxy(type));
@@ -142,32 +146,7 @@ namespace Esyur.Stores.MongoDB
resource.Instance.SetAttributes(x as Structure);
});
- var bag = new AsyncBag