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(