public void delete(UpdateAppointmentRequest request) { try { var response = new UpdateAppointmentResponse(); var bc = new AppointmentComponent(); bc.Update(request.Appointment); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public GetAppointmentResponse getById(GetAppointmentRequest request) { try { var response = new GetAppointmentResponse(); var bc = new AppointmentComponent(); response.Result = bc.Find(request.Appointment.Id); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public AllAppointmentsResponse getAll() { try { var response = new AllAppointmentsResponse(); var bc = new AppointmentComponent(); response.Result = bc.ToList(); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }