Compare commits
2 Commits
430b73b572
...
48cb1ded9c
Author | SHA1 | Date | |
---|---|---|---|
48cb1ded9c | |||
|
d33b8c0338 |
@ -44,9 +44,9 @@ namespace ComputersShopDatabaseImplement.Implements
|
||||
.ToList();
|
||||
foreach (var order in orderList)
|
||||
{
|
||||
string manufactureName = context.Computers
|
||||
string computerName = context.Computers
|
||||
.SingleOrDefault(x => x.Id == order.ComputerId)?.ComputerName ?? string.Empty;
|
||||
order.ComputerName = manufactureName;
|
||||
order.ComputerName = computerName;
|
||||
}
|
||||
return orderList;
|
||||
}
|
||||
|
@ -51,14 +51,14 @@ namespace ComputersShopFileImplement.Implements
|
||||
}
|
||||
public ComputerViewModel? Update(ComputerBindingModel model)
|
||||
{
|
||||
var manufacture = source.Computers.FirstOrDefault(x => x.Id == model.Id);
|
||||
if (manufacture == null)
|
||||
var computer = source.Computers.FirstOrDefault(x => x.Id == model.Id);
|
||||
if (computer == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
manufacture.Update(model);
|
||||
computer.Update(model);
|
||||
source.SaveComputers();
|
||||
return manufacture.GetViewModel;
|
||||
return computer.GetViewModel;
|
||||
}
|
||||
public ComputerViewModel? Delete(ComputerBindingModel model)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user