public async Task <IActionResult> CreateCommentReply([FromBody] CreateCommentReplyRequest request) { var createCommentReplyCommand = new CreateCommentReplyCommand(request); var result = await mediator.Send(createCommentReplyCommand); return(StatusCode((int)result.Code, result.Value)); }
/// <summary> /// Creates the comment reply. /// </summary> /// <param name="request">The request.</param> /// <returns></returns> public async Task <APIResponse> CreateCommentReply(CreateCommentReplyRequest request) { try { var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName); var param = JsonConvert.SerializeObject(request); HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json"); var response = await client.PostAsync(servicesConfig.Identity + VendorServiceOperation.CreateCommentReply(), contentPost); return(JsonConvert.DeserializeObject <APIResponse>(await response.Content.ReadAsStringAsync())); } catch (Exception ex) { logger.Error(ex, "Exception in method 'CreateCommentReply()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }
public async Task <IActionResult> CreateCommentReply([FromBody] CreateCommentReplyRequest request) { var result = await reviewCommentService.CreateCommentReply(request); return(StatusCode((int)result.Code, result.Value)); }