Agliullov D. A. Lab Work 2 Hard #5

Closed
d.agliullov wants to merge 26 commits from Lab2_Hard into Lab1_Hard
2 changed files with 4 additions and 5 deletions
Showing only changes of commit d6bf33d45b - Show all commits

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;
}
}
}

View File

@ -1,7 +1,6 @@
using ConfectioneryContracts.BindingModels;
using ConfectioneryContracts.ViewModels;
using ConfectioneryDataModels.Models;
using ConfectioneryDataModels.Models;
using System.Xml.Linq;
namespace ConfectioneryFileImplement.Models