public async Task <IActionResult> GetCommentReply(int commentreplyId, [FromQuery] ReplyCountParameter replyCountParameter)
        {
            var getCommentReplyQuery = new GetCommentReplyQuery(commentreplyId, replyCountParameter);
            var result = await mediator.Send(getCommentReplyQuery);

            return(StatusCode((int)result.Code, result.Value));
        }
예제 #2
0
        /// <summary>
        /// Gets all CommentReplies.
        /// </summary>
        /// <param name="averageRatingParameter">The Comment Reply parameters.</param>
        /// <returns></returns>
        public async Task <ReplyCount> GetReplyCount(ReplyCountParameter replyCountParameter)
        {
            {
                {
                    var getAverageRatingParams = new object[] {
                        new MySqlParameter("@p_Value", replyCountParameter.Value),
                        new MySqlParameter("@p_IsForReply", replyCountParameter.IsForReply),
                        new MySqlParameter("@p_IsForCildReply", replyCountParameter.IsForChildReply)
                    };
                    var AverageRating = await FindAll("CALL SpSelectActiveReplyCount(@p_Value, @p_IsForReply, @p_IsForCildReply)", getAverageRatingParams).ToListAsync();



                    return(AverageRating.FirstOrDefault());
                }
            }
        }
        public async Task <APIResponse> GetCommentReply(int commentreplyId, ReplyCountParameter replyCountParameter)
        {
            try
            {
                var client   = httpClientFactory.CreateClient(VendorServiceOperation.serviceName);
                var response = await client.GetAsync(servicesConfig.Vendor + VendorServiceOperation.GetCommentReply(commentreplyId));

                if (response.IsSuccessStatusCode)
                {
                    var reviews = JsonConvert.DeserializeObject <APIResponse>(await response.Content.ReadAsStringAsync());
                    return(new APIResponse(reviews, HttpStatusCode.OK));
                }

                return(new APIResponse(response.StatusCode));
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception in method 'GetCommentReply()'");
                var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                return(new APIResponse(exMessage, HttpStatusCode.InternalServerError));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetCommentReplyQuery"/> class.
 /// </summary>
 /// <param name="commentReplyId">The comment Reply  identifier.</param>
 public GetCommentReplyQuery(int commentReplyId, ReplyCountParameter replyCountParameter)
 {
     CommentReplyId      = commentReplyId;
     ReplyCountParameter = replyCountParameter;
 }
        public async Task <IActionResult> GetCommentReply(int commentreplyId, [FromQuery] ReplyCountParameter replyCountParameter)
        {
            var result = await reviewCommentService.GetCommentReply(commentreplyId, replyCountParameter);

            return(StatusCode((int)result.Code, result.Value));
        }