Assembly orders 2
This commit is contained in:
@@ -39,7 +39,7 @@ namespace ComputerShopDatabaseImplement.Models
|
||||
|
||||
private Dictionary<int, (IOrderModel, int)>? _assemblyOrders = null;
|
||||
[NotMapped]
|
||||
public Dictionary<int, (IOrderModel, int)> AssemblyPrders
|
||||
public Dictionary<int, (IOrderModel, int)> AssemblyOrders
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -70,6 +70,12 @@ namespace ComputerShopDatabaseImplement.Models
|
||||
{
|
||||
Component = context.Components.First(y => y.Id == x.Key),
|
||||
Count = x.Value.Item2
|
||||
}).ToList(),
|
||||
Orders = model.AssemblyOrders.Select(x => new
|
||||
AssemblyOrder
|
||||
{
|
||||
Order = context.Orders.First(y => y.Id == x.Key),
|
||||
Count = x.Value.Item2
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
@@ -84,6 +90,7 @@ namespace ComputerShopDatabaseImplement.Models
|
||||
AssemblyName = AssemblyName,
|
||||
Price = Price,
|
||||
AssemblyComponents = AssemblyComponents,
|
||||
AssemblyOrders = AssemblyOrders,
|
||||
ClientId = ClientId
|
||||
};
|
||||
public void UpdateComponents(ComputerShopDatabase context, AssemblyBindingModel model)
|
||||
|
||||
Reference in New Issue
Block a user