public async Task <IActionResult> UpdateKYCPortion(int profileId, [FromBody] UpdateKYCPortionRequest request) { var updateKYCPortionCommand = new UpdateKYCPortionCommand(profileId, request); var result = await mediator.Send(updateKYCPortionCommand); return(StatusCode((int)result.Code, result.Value)); }
/// <summary> /// Updates the kyc portion. /// </summary> /// <param name="profileId">The profile identifier.</param> /// <param name="request">The request.</param> /// <returns></returns> public async Task <APIResponse> UpdateKYCPortion(int profileId, UpdateKYCPortionRequest request) { try { var client = httpClientFactory.CreateClient(IdentityServiceOperation.serviceName); var param = JsonConvert.SerializeObject(request); HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json"); var response = await client.PutAsync(servicesConfig.Identity + IdentityServiceOperation.UpdateKYCPortion(profileId), contentPost); if (response.StatusCode == HttpStatusCode.NoContent) { } return(JsonConvert.DeserializeObject <APIResponse>(await response.Content.ReadAsStringAsync())); } catch (Exception ex) { logger.Error(ex, "Exception in method 'UpdateKYCPortion()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }
public async Task <IActionResult> UpdateKYCPortion(int profileId, [FromBody] UpdateKYCPortionRequest request) { var result = await kycDetailService.UpdateKYCPortion(profileId, request); return(StatusCode((int)result.Code, result.Value)); }
/// <summary> /// Initializes a new instance of the <see cref="UpdateKYCPortionCommand"/> class. /// </summary> /// <param name="profileId">The profile identifier.</param> /// <param name="request">The request.</param> public UpdateKYCPortionCommand(int profileId, UpdateKYCPortionRequest request) { Request = request; Id = profileId; }