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
|
||||
|
||||
Reference in New Issue
Block a user