public IHttpActionResult GetAll() { try { var emergencyContacts = _emergencyContactManager.GetAll <EmergencyContact>(); var emergencyContactsDTO = _emergencyContactFactory.CreateEmergencyContactDTO(emergencyContacts); return(Content(HttpStatusCode.OK, emergencyContactsDTO)); } catch (Exception ex) { return(Content(HttpStatusCode.InternalServerError, ex.Message)); } }
public IHttpActionResult GetAll() { try { var patients = _patientManager.GetAll <Patient>(); var addresses = _addressManager.GetAll <Address>(); var emergencyContacts = _emergencyContactManager.GetAll <EmergencyContact>(); var consultations = _consultationManager.GetAll <Consultation>(); var appointments = _appointmentManager.GetAll <Appointment>(); var patientsDTO = _patientFactory.CreatePatientDTO(patients, addresses, emergencyContacts, consultations, appointments); return(Content(HttpStatusCode.OK, patientsDTO)); } catch (Exception ex) { return(Content(HttpStatusCode.InternalServerError, ex.Message)); } }