This commit is contained in:
2020-12-08 23:53:33 +00:00
parent dd6d8f8b76
commit 45093403f7
2 changed files with 3 additions and 3 deletions

View File

@@ -174,7 +174,7 @@ namespace AyaNova.Biz
foreach (long ItemId in ContactIds) foreach (long ItemId in ContactIds)
if (!await b.DeleteAsync(ItemId, transaction)) if (!await b.DeleteAsync(ItemId, transaction))
{ {
AddError(ApiErrorCode.VALIDATION_REQUIRED,b.GetErrorsAsString()); AddError(ApiErrorCode.CHILD_OBJECT_ERROR, null, b.GetErrorsAsString());
return false; return false;
} }
} }
@@ -187,7 +187,7 @@ namespace AyaNova.Biz
foreach (long ItemId in CustomerNoteIds) foreach (long ItemId in CustomerNoteIds)
if (!await b.DeleteAsync(ItemId, transaction)) if (!await b.DeleteAsync(ItemId, transaction))
{ {
AddErrors(b.Errors); AddError(ApiErrorCode.CHILD_OBJECT_ERROR, null, b.GetErrorsAsString());
return false; return false;
} }
} }

View File

@@ -208,7 +208,7 @@ namespace AyaNova.Biz
return false; return false;
//collect the child id's to delete //collect the child id's to delete
var ItemIds = await ct.WorkOrderItem.Where(z => z.WorkOrderId == id).Select(z => z.Id).ToListAsync(); var ItemIds = await ct.WorkOrderItem.AsNoTracking().Where(z => z.WorkOrderId == id).Select(z => z.Id).ToListAsync();
//Delete children //Delete children
foreach (long ItemId in ItemIds) foreach (long ItemId in ItemIds)