コード例 #1
0
        public async Task <ActionResult> GetTopicComments(PaginationParams paginationParams, int id)
        {
            var topicComments = await _repo.GetCircleTopicCommentList(paginationParams, id);

            Response.AddPagination(topicComments.CurrentPage, topicComments.PageSize, topicComments.TotalCount, topicComments.TotalPages);
            var topicsCommentsForReturn = this._mapper.Map <IEnumerable <CircleTopicCommentForReturnDto> >(topicComments);

            foreach (var topicComment in topicsCommentsForReturn)
            {
                topicComment.ReplyCount = await _repo.GetCircleTopicCommentReplyCount(topicComment.Id);
            }
            return(Ok(topicsCommentsForReturn));
        }