From 2424828f2e52e775346e8facb464b80636d4202e Mon Sep 17 00:00:00 2001 From: dyakonovr Date: Fri, 12 Apr 2024 21:08:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=B8=D0=B7=20?= =?UTF-8?q?PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/OrderStorage.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs b/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs index b555ea6..5512397 100644 --- a/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs +++ b/SoftwareInstallation/SoftwareInstallationFileImplement/Implements/OrderStorage.cs @@ -92,12 +92,9 @@ namespace SoftwareInstallationFileImplement.Implements } private OrderViewModel GetPackageName(OrderViewModel viewModel) { - foreach (var package in source.Packages) - { - if (package.Id == viewModel.PackageId) - { - viewModel.PackageName = package.PackageName; - } + var package = source.Packages.FirstOrDefault(x => x.Id == viewModel.PackageId); + if (package != null) { + viewModel.PackageName = package.PackageName; } return viewModel; }