Пример #1
0
        public async Task <IActionResult> GetOrdersByEmail(string email)
        {
            var orders = await _orderingService.GetOrdersByUserEmailAsync(email);

            if (!orders.Any())
            {
                return(NotFound());
            }

            // ReSharper disable once InconsistentNaming
            var orderDTOs = orders
                            .Select(o => _mapper.Map <OrderDTO>(o));

            return(Ok(orderDTOs));
        }