Compare commits

...

2 Commits

Author SHA1 Message Date
48cb1ded9c Merge pull request 'fix' (#4) from lab_3 into Lab_4
Reviewed-on: http://student.git.athene.tech/Kate/ISEbd-21_Vasina_E.S._ComputersShop/pulls/4
2023-04-18 13:24:29 +04:00
evasina2312@gmail.com
d33b8c0338 fix 2023-04-18 13:22:59 +04:00
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 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)
{