This commit is contained in:
@@ -184,8 +184,19 @@ namespace AyaNova.Biz
|
||||
ValidateCanDelete(dbObject);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
if (HasErrors)
|
||||
return false;
|
||||
{
|
||||
var IDList = await ct.Review.AsNoTracking().Where(x => x.AType == AyaType.PartAssembly && x.ObjectId == id).Select(x => x.Id).ToListAsync();
|
||||
if (IDList.Count() > 0)
|
||||
{
|
||||
ReviewBiz b = new ReviewBiz(ct, UserId, UserTranslationId, CurrentUserRoles);
|
||||
foreach (long ItemId in IDList)
|
||||
if (!await b.DeleteAsync(ItemId, transaction))
|
||||
{
|
||||
AddError(ApiErrorCode.CHILD_OBJECT_ERROR, null, $"Review [{ItemId}]: {b.GetErrorsAsString()}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
ct.PartAssembly.Remove(dbObject);
|
||||
await ct.SaveChangesAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user