From 7138cc713fc1511a4a2224f58cb401835ed6c534 Mon Sep 17 00:00:00 2001 From: Alina Batylkina Date: Thu, 20 Apr 2023 22:15:35 +0400 Subject: [PATCH] =?UTF-8?q?4=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssembly/FurnitureAssemblyView.csproj | 13 ++++++------- .../BusinessLogics/ReportLogic.cs | 10 +++------- .../FurnitureAssemblyBusinessLogic.csproj | 2 +- .../FurnitureAssemblyDatabaseImplement.csproj | 6 +++--- .../Implements/FurnitureStorage.cs | 2 +- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssembly/FurnitureAssemblyView.csproj b/FurnitureAssembly/FurnitureAssembly/FurnitureAssemblyView.csproj index 3227514..0467864 100644 --- a/FurnitureAssembly/FurnitureAssembly/FurnitureAssemblyView.csproj +++ b/FurnitureAssembly/FurnitureAssembly/FurnitureAssemblyView.csproj @@ -9,15 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + @@ -31,7 +30,7 @@ - Never + Always diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BusinessLogics/ReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BusinessLogics/ReportLogic.cs index 3206ab9..7fb943c 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/BusinessLogics/ReportLogic.cs @@ -38,7 +38,6 @@ namespace AbstractShopBusinessLogic.BusinessLogics public List GetFurnitureComponent() { var furnitures = _furnitureStorage.GetFullList(); - var components = _componentStorage.GetFullList(); var list = new List(); foreach (var furniture in furnitures) { @@ -48,13 +47,10 @@ namespace AbstractShopBusinessLogic.BusinessLogics Components = new List>(), TotalCount = 0 }; - foreach (var component in components) + foreach (var component in furniture.FurnitureComponents) { - if (furniture.FurnitureComponents.ContainsKey(component.Id)) - { - record.Components.Add(new Tuple(component.ComponentName, furniture.FurnitureComponents[component.Id].Item2)); - record.TotalCount += furniture.FurnitureComponents[component.Id].Item2; - } + record.Components.Add(new (component.Value.Item1.ComponentName, component.Value.Item2)); + record.TotalCount += component.Value.Item2; } list.Add(record); } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj index d40e021..c8d5da0 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj @@ -8,7 +8,7 @@ - + diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabaseImplement.csproj b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabaseImplement.csproj index faf708d..cfa719e 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabaseImplement.csproj +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/FurnitureAssemblyDatabaseImplement.csproj @@ -7,9 +7,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs index 0a4ce41..67bbf29 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Implements/FurnitureStorage.cs @@ -18,7 +18,7 @@ namespace FurnitureAssemblyDatabaseImplement.Implements { using var context = new FurnitureAssemblyDatabase(); return context.Furnitures - .Include(x => x.Components) + .Include(x => x.Components) .ThenInclude(x => x.Component) .ToList() .Select(x => x.GetViewModel)