Ejemplo n.º 1
0
        public ActionResult <PacientReadDTO> GetPacientById(int id)
        {
            var pacientFromRepo = _repository.GetPacientById(id);

            if (pacientFromRepo != null)
            {
                return(Ok(_mapper.Map <PacientReadDTO>(pacientFromRepo)));
            }
            return(NotFound());
        }
Ejemplo n.º 2
0
        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)));
        }