diff --git a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs index 5a9ae3e..d624de4 100644 --- a/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyFileImplement/Implements/OrderStorage.cs @@ -45,17 +45,13 @@ namespace FurnitureAssemblyFileImplement.Implements return source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } - // Для загрузки названий изделия в заказе private OrderViewModel GetViewModel(Order order) { var viewModel = order.GetViewModel; var furniture = source.Furnitures.FirstOrDefault(x => x.Id == order.FurnitureId); - if (furniture != null) - { - viewModel.FurnitureName = furniture.FurnitureName; - } + viewModel.FurnitureName = furniture?.FurnitureName; return viewModel; }