Ejemplo n.º 1
0
 public static Dal.OrderUpdatingData ToDalOrderUpdatingData(this Dal.Order order)
 {
     return(new Dal.OrderUpdatingData
     {
         OrderId = order.Id,
         Items = order.Items.Select(x => x.ToDalOrderItemManagementData(order.Id)).ToList(),
         Status = order.Status
     });
 }
Ejemplo n.º 2
0
 public static Order ToOrder(this Dal.Order order)
 {
     return(new Order
     {
         Id = order.Id,
         CreationDate = order.CreationDate,
         Customer = order.Customer,
         Items = order.Items,
         Status = (OrderStatus)order.Status,
         Total = order.Items.Any() ? order.Items.Sum(x => x.Price * x.Quantity) : 0
     });
 }