コード例 #1
0
 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());
 }
コード例 #2
0
        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
            });
        }