From 311b70d3bea3de25578f2ffd40bacc44d2b10943 Mon Sep 17 00:00:00 2001 From: bekodeg Date: Wed, 1 May 2024 18:18:25 +0400 Subject: [PATCH] + --- .../Implements/ComponentStorage.cs | 2 +- .../Implements/ProductStorage.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs index 9fdc559..cb2d4ff 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ComponentStorage.cs @@ -46,7 +46,7 @@ namespace ComputerHardwareStoreDatabaseImplement.Implements public ComponentViewModel? Insert(ComponentBindingModel model) { using var context = new ComputerHardwareStoreDBContext(); - var newComponent = Component.Create(context, model); + var newComponent = Component.Create(model); if (newComponent == null) { return null; diff --git a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ProductStorage.cs b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ProductStorage.cs index d27a131..2d44cc2 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ProductStorage.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/Implements/ProductStorage.cs @@ -27,7 +27,7 @@ namespace ComputerHardwareStoreDatabaseImplement.Implements } using var context = new ComputerHardwareStoreDBContext(); return context.Products - .Where(p => (p.StoreKeeperId == model.StoreKeeperId) + .Where(p => (p.StoreKeeper.Id == model.StoreKeeperId) // есть хотя бы 1 общий со сборкой компонент && (!model.BuildId.HasValue || p.Components.FirstOrDefault (c => c.Component.BuldComponents.FirstOrDefault(