Esempio n. 1
0
        public IActionResult GetAnimals(string sortBy)
        {
            List <GetAnimalsResponse> response = _service.GetAnimals(sortBy);

            if (response == null)
            {
                return(BadRequest(400));
            }
            return(Ok(response));
        }
        public IActionResult GetAnimals(string sortBy)
        {
            var result = _dbService.GetAnimals(sortBy);

            if (result == null)
            {
                ObjectResult res = new ObjectResult(result);
                res.StatusCode = 400;
                return(res);
            }
            return(Ok(result));
        }
Esempio n. 3
0
 // Np: GetAnimals("name", "asc");
 public IActionResult GetAnimals(string sortBy, string order)
 {
     return(StatusCode(200, _service.GetAnimals(sortBy, order)));
 }