2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00
This commit is contained in:
2023-01-11 16:09:16 +03:00
parent 58c705bfc6
commit f8b70d1ea6
3 changed files with 23 additions and 4 deletions

View File

@ -71,6 +71,11 @@ public class EntityStore : IStore
foreach (var rf in ent.References)
rf.Load();
foreach(var nav in ent.Navigations)
nav.Load();
//var refs = ent.References.ToList();
return new AsyncReply<IResource>(res as IResource);
}
@ -158,7 +163,21 @@ public class EntityStore : IStore
public bool Remove(IResource resource)
{
throw new NotImplementedException();
var type = ResourceProxy.GetBaseType(resource);
var eid = TypesByType[type].PrimaryKey.GetValue(resource);
lock (DBLock)
{
if (DB[type].ContainsKey(eid))
{
DB[type].Remove(eid);
return true;
}
}
return false;
//throw new NotImplementedException();
}
public AsyncReply<bool> AddChild(IResource parent, IResource child)