private static List <SalesOrderItemModel> SerializeSalesOrderItems(IEnumerable <SalesOrderItem> orderItems) { return(orderItems.Select(item => new SalesOrderItemModel { Id = item.Id, Quantity = item.Quantity, Material = MaterialMapper.SerializeMaterialModel(item.Material) }).ToList()); }
public static SalesOrder SerializeInvoiceToOrder(InvoiceModel invoice) { var salesOrderItems = invoice.LineItems.Select(item => new SalesOrderItem { Id = item.Id, Quantity = item.Quantity, Material = MaterialMapper.SerializeMaterialModel(item.Material) }).ToList(); return(new SalesOrder { SalesOrderItems = salesOrderItems, CreatedAt = DateTime.UtcNow, UpdatedAt = DateTime.UtcNow }); }