Example #1
0
 public static CreateOrderDto ToDto(CreateOrder order) => new CreateOrderDto
 {
     CustomerId     = order.CustomerId,
     CreationDate   = order.CreationDate,
     DeliveryStatus = order.DeliveryStatus,
     PaymentStatus  = order.PaymentStatus,
     Goods          = order.Goods.Select(g => GoodConverter.ToDto(g)).ToList()
 };
Example #2
0
 public static Order FromDto(GetOrderDto orderDto) => new Order
 {
     Id             = orderDto.Id,
     Customer       = CustomerConverter.FromDto(orderDto.Customer),
     CreationDate   = orderDto.CreationDate,
     PaymentStatus  = orderDto.PaymentStatus,
     DeliveryStatus = orderDto.DeliveryStatus,
     Price          = orderDto.Price,
     Goods          = orderDto.Goods.Select(g => GoodConverter.FromDto(g)).ToList()
 };