public void delete(UpdateDoctorRequest request) { try { var response = new UpdateDoctorResponse(); var bc = new DoctorComponent(); bc.Update(request.Doctor); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public GetDoctorResponse getById(int id) { try { var response = new GetDoctorResponse(); var bc = new DoctorComponent(); response.Result = bc.Find(id); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public AddDoctorResponse add(AddDoctorRequest request) { try { var response = new AddDoctorResponse(); var bc = new DoctorComponent(); response.Result = bc.Add(request.Doctor); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public AllDoctorsResponse getAll() { try { var response = new AllDoctorsResponse(); var bc = new DoctorComponent(); response.Result = bc.ToList(); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }