コード例 #1
0
        public override async Task <ActionResult <UpdateDoctorResponse> > HandleAsync(UpdateDoctorRequest request, CancellationToken cancellationToken)
        {
            var response = new UpdateDoctorResponse(request.CorrelationId());

            var toUpdate = _mapper.Map <Doctor>(request);
            await _repository.UpdateAsync <Doctor, int>(toUpdate);

            var dto = _mapper.Map <DoctorDto>(toUpdate);

            response.Doctor = dto;

            return(Ok(response));
        }
コード例 #2
0
 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);
     }
 }