This commit is contained in:
Salikh 2024-04-03 15:50:05 +04:00
parent 2d9551268a
commit a528263511

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;
}
}