public IActionResult GetAll([FromServices] IClienteApplicationService clienteApplicationService) { try { return(Ok(clienteApplicationService.GetAll())); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public ActionResult <IEnumerable <string> > Get() { try { var results = _clienteApplicationService.GetAll(); return(Ok(results)); } catch (Exception ex) { return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Banco Dados Falhou {ex.Message}")); } }
public IActionResult GetAll() { try { var result = clienteApplicationService.GetAll(); return(Ok(result)); } catch (Exception e) { new Exception("Erro ao selecionar o Aluno", e); return(this.BadRequest()); } }
public IActionResult GetAll() { try { var result = _clienteApplicationService.GetAll(); if (result == null || result.Count == 0) { return(StatusCode(204)); } return(StatusCode(200, result)); } catch (Exception e) { return(StatusCode(500, new { e.Message })); } }
public ActionResult <IEnumerable <string> > Get() { return(Ok(_clienteApp.GetAll())); }
public IEnumerable <ClienteDto> GetAll() { return(_clienteApplicationSerice.GetAll()); }