PIbd-21 Yaruskin S.A. LabWork05_Hard #29

Closed
Salikh wants to merge 23 commits from lab5-hard into laba5
Showing only changes of commit a528263511 - Show all commits

View File

@ -83,14 +83,8 @@ namespace MotorPlantFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
foreach (var comp in source.Engines)
{
if (comp.Id == order.EngineId)
{
viewModel.EngineName = comp.EngineName;
break;
}
}
var engine = source.Engines.FirstOrDefault(x => x.Id == order.EngineId);
viewModel.EngineName = engine?.EngineName;
return viewModel;
}
}