This commit is contained in:
2021-04-13 23:52:46 +00:00
parent a73643e403
commit c333da5574

View File

@@ -191,15 +191,8 @@ namespace AyaNova.Biz
//
internal async Task<WorkOrder> WorkOrderPutAsync(WorkOrder putObject)
{
//BUGBUG: put object has no children
//this code replaces db object with put object and
//in doing so removes all children from db object
//potential solutions:
// go back to copy object
// don't fetch entire graph of dbObject (perhaps that prevents it getting affected)
//somehow ignore certain properties on update??
//WorkOrder dbObject = await WorkOrderGetAsync(putObject.Id, false);
//Note: this is intentionally not using the getasync because
//doing so would invoke the children which would then get deleted on save since putobject has no children
WorkOrder dbObject = await ct.WorkOrder.AsNoTracking().FirstOrDefaultAsync(z=>z.Id==putObject.Id);
if (dbObject == null)
{