public ActionResult <PacientReadDTO> GetPacientById(int id) { var pacientFromRepo = _repository.GetPacientById(id); if (pacientFromRepo != null) { return(Ok(_mapper.Map <PacientReadDTO>(pacientFromRepo))); } return(NotFound()); }
public ActionResult <IEnumerable <AppointmentReadDTO> > GetAppointmentsForPacient(int pacientId) { if (_pacientRepository.GetPacientById(pacientId) == null) { return(NotFound()); } var appointmentsFromPacientFromRepo = _pacientRepository.GetAppointments(pacientId); return(Ok(_mapper.Map <IEnumerable <AppointmentReadDTO> >(appointmentsFromPacientFromRepo))); }