product mtm
This commit is contained in:
parent
ca6035d7a1
commit
0fd8a7fd8f
@ -39,12 +39,15 @@ namespace ComputerHardwareStoreDatabaseImplement.Models
|
|||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
Name = model.Name,
|
Name = model.Name,
|
||||||
Price = model.Price,
|
Price = model.Price,
|
||||||
Components = model.ProductComponents.Select(x =>
|
Components = context.Components
|
||||||
new ProductComponent
|
.Where(c => model.ProductComponents.ContainsKey(c.Id))
|
||||||
|
.Select(c => new ProductComponent()
|
||||||
{
|
{
|
||||||
Component = context.Components.First(y => y.Id == x.Key),
|
ProductId = model.Id,
|
||||||
Count = x.Value.Item2
|
ComponentId = c.Id,
|
||||||
}).ToList()
|
Component = c,
|
||||||
|
Count = model.ProductComponents[c.Id].Item2
|
||||||
|
}).ToList(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public void Update(ProductBindingModel model)
|
public void Update(ProductBindingModel model)
|
||||||
|
Loading…
Reference in New Issue
Block a user