Compare commits

..

No commits in common. "48cb1ded9c16d33f6d9e87e985b9c06f51228b02" and "430b73b572772c98b1c247d97472b321d6bc7717" have entirely different histories.

2 changed files with 6 additions and 6 deletions

View File

@ -44,9 +44,9 @@ namespace ComputersShopDatabaseImplement.Implements
.ToList();
foreach (var order in orderList)
{
string computerName = context.Computers
string manufactureName = context.Computers
.SingleOrDefault(x => x.Id == order.ComputerId)?.ComputerName ?? string.Empty;
order.ComputerName = computerName;
order.ComputerName = manufactureName;
}
return orderList;
}

View File

@ -51,14 +51,14 @@ namespace ComputersShopFileImplement.Implements
}
public ComputerViewModel? Update(ComputerBindingModel model)
{
var computer = source.Computers.FirstOrDefault(x => x.Id == model.Id);
if (computer == null)
var manufacture = source.Computers.FirstOrDefault(x => x.Id == model.Id);
if (manufacture == null)
{
return null;
}
computer.Update(model);
manufacture.Update(model);
source.SaveComputers();
return computer.GetViewModel;
return manufacture.GetViewModel;
}
public ComputerViewModel? Delete(ComputerBindingModel model)
{