mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-09-13 12:43:17 +00:00
1
This commit is contained in:
@@ -185,25 +185,7 @@ public class EntityStore : IStore
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool Remove(IResource resource)
|
||||
{
|
||||
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)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -290,4 +272,32 @@ public class EntityStore : IStore
|
||||
{
|
||||
OnDestroy?.Invoke(this);
|
||||
}
|
||||
|
||||
public AsyncReply<bool> Remove(IResource resource)
|
||||
{
|
||||
var type = ResourceProxy.GetBaseType(resource);
|
||||
|
||||
var eid = TypesByType[type].PrimaryKey.GetValue(resource);
|
||||
|
||||
lock (DBLock)
|
||||
{
|
||||
if (DB[type].ContainsKey(eid))
|
||||
{
|
||||
DB[type].Remove(eid);
|
||||
return new AsyncReply<bool>(true);
|
||||
}
|
||||
}
|
||||
|
||||
return new AsyncReply<bool>(false);
|
||||
}
|
||||
|
||||
public AsyncReply<bool> Remove(string path)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public AsyncReply<bool> Move(IResource resource, string newPath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user