Exemplo n.º 1
0
        public IActionResult GetAll()
        {
            var result = _directoryService.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> GetAll()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                return(Ok(await _service.GetAll()));
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
 public ActionResult <List <Directory> > GetAll()
 {
     return(_directoryService.GetAll());
 }