Example #1
0
        public OrderDto PrepareOrderDTO(Order order)
        {
            OrderDto orderDto = order.ToDto();

            CustomerDto customerDto = _customerApiService.GetCustomerById(order.Customer.Id);

            if (customerDto != null)
            {
                orderDto.Customer = customerDto.ToOrderCustomerDto();
            }

            return(orderDto);
        }
Example #2
0
        public OrderDto PrepareOrderDTO(Order order)
        {
            OrderDto orderDto = order.ToDto();

            orderDto.OrderItemDtos = order.OrderItems.Select(orderItem => PrepareOrderItemDTO(orderItem)).ToList();

            CustomerDto customerDto = _customerApiService.GetCustomerById(order.Customer.Id);

            if (customerDto != null)
            {
                orderDto.Customer = customerDto.ToOrderCustomerDto();
            }

            return(orderDto);
        }