public void delete(UpdatePatientRequest request) { try { var response = new UpdatePatientResponse(); var bc = new PatientComponent(); bc.Update(request.Patient); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public GetPatientResponse getById(GetPatientRequest request) { try { var response = new GetPatientResponse(); var bc = new PatientComponent(); response.Result = bc.Find(request.Patient.Id); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public AllPatientsResponse getAll() { try { var response = new AllPatientsResponse(); var bc = new PatientComponent(); response.Result = bc.ToList(); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }