fix #4

Merged
Kate merged 1 commits from lab_3 into Lab_4 2023-04-18 13:24:30 +04:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit d33b8c0338 - Show all commits

View File

@ -35,9 +35,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;
}

View File

@ -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)
{