Compare commits
No commits in common. "48cb1ded9c16d33f6d9e87e985b9c06f51228b02" and "430b73b572772c98b1c247d97472b321d6bc7717" have entirely different histories.
48cb1ded9c
...
430b73b572
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user