Assembly orders 2

This commit is contained in:
the
2023-05-18 18:33:33 +04:00
parent 1a849e4fbd
commit 49b8f15517
3 changed files with 18 additions and 1 deletions

View File

@@ -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)