public static Models.Orders MapOrder(Models.Orders o) { return(new Models.Orders() { OrderId = o.OrderId, StoreId = o.StoreId, UserId = o.UserId, PizzaAmount = o.PizzaAmount, Cost = o.Cost, OrderTime = o.OrderTime }); }
internal static IOrder Map(Domain.Models.Orders orders) { if (orders == null) { return(null); } return(new CompletedOrder() { Store = Map(orders.Store), User = Map(orders.User), Price = orders.Price, Ordertime = orders.Ordertime, Pizzas = from pizza in orders.Pizza select PizzaMapper.Map(pizza) }); }
internal static Domain.Models.Orders Map(IOrder order) { if (order == null) { return(null); } var o = new Domain.Models.Orders() { Price = order.Price, Storeid = order.Store.Id, Userid = order.User.Id, }; int i = 0; foreach (var pizza in order.Pizzas) { var mappedPizza = Map(pizza); mappedPizza.PizzaNum = ++i; o.Pizza.Add(mappedPizza); } return(o); }