示例#1
0
        public async Task <ActionResult <List <OrderDto> > > GetOrdersByCustomer(int customerID)
        {
            _orm.OpenConn();
            var ordersFromDB = await _orm.GetOrdersByCustomerId(customerID);

            if (ordersFromDB == null)
            {
                return(NotFound());
            }
            var orderDto = _mapper.Map <List <OrderDto> >(ordersFromDB);

            await _orm.CloseConn();

            return(Ok(orderDto));
        }