Ejemplo n.º 1
0
        //http://localhost:5000/api/customers?email=k
        public async Task <ActionResult <List <CustomerDto> > > GetCustomers([FromQuery] CustomerParameters customerParameters)
        {
            _orm.OpenConn();

            var customersFromDB = await _orm.GetAllCustomers(customerParameters);

            if (customersFromDB == null)
            {
                return(NotFound());
            }
            var customersDto = _mapper.Map <List <CustomerDto> >(customersFromDB);
            await _orm.CloseConn();

            return(Ok(customersDto));
        }