public static List <OrderDetailJson> From(List <OrderDetail> items) { List <OrderDetailJson> results = new List <OrderDetailJson>(); if (items == null) { return(results); } foreach (var a in items) { results.Add(OrderDetailJson.From(a)); } return(results); }
public static OrderJson From(Order item) { var result = new OrderJson() { OrderId = item.OrderId, OrderDate = item.OrderDate, Username = item.Username, FirstName = item.FirstName, LastName = item.LastName, Address = item.Address, City = item.City, State = item.State, PostalCode = item.PostalCode, Country = item.Country, Phone = item.Phone, Email = item.Email, Total = item.Total, OrderDetails = OrderDetailJson.From(item.OrderDetails) }; return(result); }