Exemplo n.º 1
0
        public async Task <ActionResult> GetEventComments(PaginationParams paginationParams, int id)
        {
            var eventComments = await _repo.GetCircleEventCommentList(paginationParams, id);

            Response.AddPagination(eventComments.CurrentPage, eventComments.PageSize, eventComments.TotalCount, eventComments.TotalPages);
            var eventCommentsForReturn = this._mapper.Map <IEnumerable <CircleEventCommentForReturnDto> >(eventComments);

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