public static Order MapOrder(Entities.OrderInfo OI) { var store = MapStore(OI.Store); var cust = MapCustomer(OI.Customer); Order h = new Order(cust, store, OI.Id, OI.OrderTime); foreach (Entities.OrderDetails item in OI.OrderDetails) { var prod = MapMerch(item.ProductNameNavigation); h.details.Add(prod, item.Order.MerchAmount); } return(h); }
public static Order MapOrder(Entities.OrderInfo OI) { var store = OI.Store is null ? null : MapStore(OI.Store); var cust = MapCustomer(OI.Customer); Order h = new Order(cust, store, OI.Id, OI.OrderTime); foreach (Entities.OrderDetails item in OI.OrderDetails) { var prod = MapMerch(item.Merch); h.details.Add(prod, item.Stock); } return(h); }