This commit is contained in:
Николай 2023-03-12 10:57:32 +04:00
parent 73682b5a21
commit bdfba8ffa7

View File

@ -3,6 +3,8 @@ using FoodOrdersContracts.SearchModels;
using FoodOrdersContracts.StoragesContracts;
using FoodOrdersContracts.ViewModels;
using FoodOrdersFileImplement.Models;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
namespace FoodOrdersFileImplement.Implements
{
@ -38,14 +40,7 @@ namespace FoodOrdersFileImplement.Implements
private OrderViewModel GetViewModel(Order order)
{
var viewModel = order.GetViewModel;
foreach (var dish in _source.Dishes)
{
if (dish.Id == order.DishId)
{
viewModel.DishName = dish.DishName;
break;
}
}
viewModel.DishName = _source.Dishes.FirstOrDefault(x => (x.Id == order.DishId))?.DishName;
return viewModel;
}