示例#1
0
        public IHttpActionResult GetComment(long commentId)
        {
            CommentDto commentDto = CommentDto.CreateCommentDto(commentRepository.GetComment(commentId));

            commentDto.TotalLikeCount    = voteRepository.GetTotalLikesCounts(commentId);
            commentDto.TotalDislikeCount = voteRepository.GetTotalDislikesCounts(commentId);
            return(Ok(commentDto));
        }
示例#2
0
 public IHttpActionResult GetComments(long postId)
 {
     return(Ok(commentRepository.GetComments(postId).Select(c =>
     {
         CommentDto commentDto = CommentDto.CreateCommentDto(c);
         commentDto.TotalLikeCount = voteRepository.GetTotalLikesCounts(commentDto.CommentId);
         commentDto.TotalDislikeCount = voteRepository.GetTotalDislikesCounts(commentDto.CommentId);
         return commentDto;
     }).ToList()));
 }