ПИбд-23 Волков Никита Андреевич Лабораторная работа №2 Усложненная #7

Closed
bocchanskyy wants to merge 6 commits from Lab2Hard into Lab1Hard
Showing only changes of commit 3aef079512 - Show all commits

View File

@ -82,14 +82,11 @@ namespace ComputersShopFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
foreach (var comp in source.Computers)
{
if (comp.Id == order.ComputerId)
var comp = source.Computers.FirstOrDefault(comp => comp.Id == order.ComputerId);
if (comp != null)
{
viewModel.ComputerName = comp.ComputerName;
break;
}
}
return viewModel;
}
}