public GetAppointmentResponse Get(GetAppointmentRequest request)
        {
            var appointment = this.appointmentsApplication.Get(Request.ToCaller(), request.Id);

            return(new GetAppointmentResponse
            {
                Appointment = appointment
            });
        }
Пример #2
0
        public void Initialize()
        {
            this.identifierFactory = new Mock <IIdentifierFactory>();
            this.identifierFactory.Setup(f => f.IsValid(It.IsAny <Identifier>())).Returns(true);
            this.validator = new GetAppointmentRequestValidator(this.identifierFactory.Object);

            this.dto = new GetAppointmentRequest
            {
                Id = "anid"
            };
        }
        public async Task <IActionResult> GetAppointments([FromQuery] GetAppointmentRequest request)
        {
            var clinicsRequest = await appointmentApi.GetAppointments(request);

            if (!clinicsRequest.IsSuccessStatusCode)
            {
                return(await clinicsRequest.GetActionResult());
            }

            var clinics = await clinicsRequest.Content.DeserializeStringContent <IEnumerable <GetAppointmentResponse> >();

            return(Ok(clinics));
        }
Пример #4
0
 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);
     }
 }