public IActionResult GetAll() { var result = _directoryService.GetAll(); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
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()); }