mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-07 12:02:59 +00:00
Store.Remove
This commit is contained in:
parent
f8b70d1ea6
commit
73fb67b860
@ -66,6 +66,16 @@ public class EntityStore : IStore
|
|||||||
var db = Getter();
|
var db = Getter();
|
||||||
var res = db.Find(ti.Type.ClrType, id);
|
var res = db.Find(ti.Type.ClrType, id);
|
||||||
|
|
||||||
|
if (res == null)
|
||||||
|
{
|
||||||
|
return new AsyncReply<IResource>(null);
|
||||||
|
|
||||||
|
//var rt = new AsyncReply<IResource>();
|
||||||
|
//rt.TriggerError(new AsyncException(ErrorType.Management,
|
||||||
|
// (ushort)ExceptionCode.ResourceNotFound, "Resource not found."));
|
||||||
|
//return rt;
|
||||||
|
}
|
||||||
|
|
||||||
// load navigation properties
|
// load navigation properties
|
||||||
var ent = db.Entry(res);
|
var ent = db.Entry(res);
|
||||||
foreach (var rf in ent.References)
|
foreach (var rf in ent.References)
|
||||||
@ -202,7 +212,7 @@ public class EntityStore : IStore
|
|||||||
|
|
||||||
public AsyncBag<T> Children<T>(IResource resource, string name) where T : IResource
|
public AsyncBag<T> Children<T>(IResource resource, string name) where T : IResource
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return new AsyncBag<T>(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AsyncBag<T> Parents<T>(IResource resource, string name) where T : IResource
|
public AsyncBag<T> Parents<T>(IResource resource, string name) where T : IResource
|
||||||
|
@ -396,7 +396,7 @@ public static class Warehouse
|
|||||||
for (var i = 1; i < p.Length; i++)
|
for (var i = 1; i < p.Length; i++)
|
||||||
{
|
{
|
||||||
var children = await resource.Instance.Children<IResource>(p[i]);
|
var children = await resource.Instance.Children<IResource>(p[i]);
|
||||||
if (children.Length > 0)
|
if (children != null && children.Length > 0)
|
||||||
{
|
{
|
||||||
if (i == p.Length - 1)
|
if (i == p.Length - 1)
|
||||||
return children;
|
return children;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user