public ActionResult <IEnumerable <AppointmentReadDTO> > GetAppointmentsForDoctor(int doctorId) { if (_doctorRepository.GetDoctorById(doctorId) == null) { return(NotFound()); } var appointmentsFromDoctorFromRepo = _doctorRepository.GetAppointments(doctorId); return(Ok(_mapper.Map <IEnumerable <AppointmentReadDTO> >(appointmentsFromDoctorFromRepo))); }
public ActionResult <DoctorReadDTO> GetDoctorById(int id) { var doctor = _repository.GetDoctorById(id); if (doctor != null) { return(Ok(_mapper.Map <DoctorReadDTO>(doctor))); } return(NotFound()); }