async public Task CreateOrder([FromBody] OrderDTO orderDTO)
        {
            try
            {
                if (orderDTO.Details != null && orderDTO.Details.Count() > 0)
                {
                    orderDTO.Details.ToList().ForEach(od => od.OrderId = orderDTO.Id);
                }

                var order = new Models.Order()
                {
                    Id           = orderDTO.Id,
                    CustomerId   = orderDTO.CustomerId,
                    CustomerName = orderDTO.CustomerName,
                    CreatedDate  = orderDTO.CreatedDate,
                };

                var details = new List <Models.OrderDetail>();
                foreach (var detail in orderDTO.Details)
                {
                    var newDetail = new Models.OrderDetail()
                    {
                        Id        = detail.Id,
                        OrderId   = detail.OrderId,
                        ProductId = detail.ProductId,
                        Quantity  = detail.Quantity,
                        Price     = detail.Price
                    };

                    details.Add(newDetail);
                }

                //order.Details = details;

                _logger.LogInformation($"Order {order.Id} about to be created");

                await _orderService.CreateOrder(order, details);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error when create order with ID " + orderDTO.Id);
                throw;
            }
        }
 async public Task CreateOrder(Models.Order order, IEnumerable <Models.OrderDetail> details)
 {
     _ordersDbContext.Orders.Add(order);
     _ordersDbContext.OrderDetails.AddRange(details);
     await _ordersDbContext.SaveChangesAsync();
 }