public async Task <IActionResult> Index() { try { List <Paciente> pacientes = await _pacienteService.GetAllPacientes(); return(View(pacientes)); } catch (Exception ex) { throw ex; } }
public ActionResult <IEnumerable <Paciente> > Get() { try { return(_pacienteService.GetAllPacientes().ToList()); } catch (Exception e) { return(BadRequest(e.Message)); throw; } }