public orderDao OrderToOrderDao(order o) { orderDao od = new orderDao(); od.Id = o.Id; od.Name = o.Name; od.products = new List <productDao>(); foreach (var item in o.products) { od.products.Add(ProductToProductDao(item)); } od.totalPrice = o.totalPrice; return(od); }
public order OrderDaoToOrder(orderDao od) { order o = new order(); o.Id = od.Id; o.Name = od.Name; o.totalPrice = od.totalPrice; List <product> lp = new List <product>(); foreach (var item in od.products) { lp.Add(ProductDaoToProduct(item)); } o.products = lp.ToArray(); return(o); }