This commit is contained in:
bekodeg 2024-04-30 20:11:52 +04:00
parent 26a687363e
commit fb7db4b90b

View File

@ -51,12 +51,14 @@ namespace ComputerHardwareStoreDatabaseImplement.Models
Status = model.Status, Status = model.Status,
DateCreate = model.DateCreate, DateCreate = model.DateCreate,
DateImplement = model.DateImplement, DateImplement = model.DateImplement,
Products = model.OrderProducts Products = context.Products
.Select(op => new OrderProduct() .Where(p => model.OrderProducts.ContainsKey(p.Id))
.Select(p => new OrderProduct()
{ {
OrderId = model.Id, OrderId = model.Id,
ProductId = op.Key, ProductId = p.Id,
Count = op.Value.Item2 Product = p,
Count = model.OrderProducts[p.Id].Item2
}) })
.ToList() .ToList()
}; };
@ -78,7 +80,5 @@ namespace ComputerHardwareStoreDatabaseImplement.Models
DateCreate = DateCreate, DateCreate = DateCreate,
DateImplement = DateImplement, DateImplement = DateImplement,
}; };
public Dictionary<int, (IProductModel, int)> OrderProduct => throw new NotImplementedException();
} }
} }