From f83986aa7bbb60f311ec52094f4ed7c5212c0317 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Fri, 24 Feb 2023 12:27:33 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/OrderStorage.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs index bcb6ffb..250a67e 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs @@ -51,14 +51,11 @@ namespace BlacksmithWorkshopFileImplement.Implements { var viewModel = order.GetViewModel; - foreach(var manufacture in source.Manufactures) - { - if(manufacture.Id == order.ManufactureId) - { - viewModel.ManufactureName = manufacture.ManufactureName; + var manufacture = source.Manufactures.FirstOrDefault(x => x.Id == order.ManufactureId); - break; - } + if(manufacture != null) + { + viewModel.ManufactureName = manufacture.ManufactureName; } return viewModel;