mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 14:38:43 +00:00
Ver 3
This commit is contained in:
@@ -131,7 +131,7 @@ public static class EsiurExtensions
|
||||
|
||||
var id = store.TypesByType[typeof(T)].PrimaryKey.GetValue(resource);
|
||||
|
||||
await options.Warehouse.Put($"{store.Instance.Name}/{typeof(T).Name}/{id}", res, 0, manager);
|
||||
await options.Warehouse.Put($"{store.Instance.Name}/{typeof(T).Name}/{id}", res, new ResourceContext(0, null, null, manager));
|
||||
|
||||
return (T)res;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,9 @@ public class EsiurProxyRewrite : IModelFinalizingConvention
|
||||
if (Codec.ImplementsInterface(entityType.ClrType, typeof(IResource)))
|
||||
{
|
||||
// check if the object exists
|
||||
var obj = options.Warehouse.Create(entityType.ClrType) as IResource;
|
||||
var obj = options.Warehouse.Create(entityType.ClrType, null) as IResource;
|
||||
options.Store.TypesByType[entityType.ClrType].PrimaryKey.SetValue(obj, id);
|
||||
options.Warehouse.Put($"{options.Store.Instance.Name}/{entityType.ClrType.Name}/{id}", obj, 0, manager).Wait();
|
||||
options.Warehouse.Put($"{options.Store.Instance.Name}/{entityType.ClrType.Name}/{id}", obj, new ResourceContext(0, null, null, manager)).Wait();
|
||||
return obj;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Esiur.Stores.MongoDB
|
||||
public class MongoDBStore<T> : MongoDBStore where T:IResource
|
||||
{
|
||||
[Export]
|
||||
public async AsyncReply<T> New(string name = null, object properties = null)
|
||||
public async AsyncReply<T> New(string name = null, Map<string, object> properties = null)
|
||||
{
|
||||
var resource = Instance.Warehouse.Create<T>(properties);
|
||||
await Instance.Warehouse.Put(this.Instance.Name + "/" + name, resource);
|
||||
|
||||
Reference in New Issue
Block a user