+
This commit is contained in:
parent
0cf11372a7
commit
311b70d3be
@ -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;
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user