снова готовая 2 лаба

This commit is contained in:
a.puchkina 2024-03-26 18:17:20 +04:00
parent 9d66bdb886
commit 4782337fca

View File

@ -82,14 +82,8 @@ namespace TravelCompanyFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
foreach (var comp in source.Travels)
{
if (comp.Id == order.TravelId)
{
viewModel.TravelName = comp.TravelName;
break;
}
}
var travel = source.Travels.FirstOrDefault(x => x.Id == order.TravelId);
viewModel.TravelName = travel?.TravelName;
return viewModel;
}
}