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