Merge branch 'Lab2_Base' into Lab2_Hard

This commit is contained in:
Данияр Аглиуллов 2023-02-18 16:14:31 +04:00
commit cf2fd40f87

View File

@ -63,14 +63,14 @@ namespace ConfectioneryFileImplement
public OrderViewModel? Update(OrderBindingModel model)
{
var pastry = _source.Orders.FirstOrDefault(x => x.Id == model.Id);
if (pastry == null)
var order = _source.Orders.FirstOrDefault(x => x.Id == model.Id);
if (order == null)
{
return null;
}
pastry.Update(model);
order.Update(model);
_source.SaveOrders();
return pastry.GetViewModel;
return order.GetViewModel;
}
}
}