Esempio n. 1
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()));
 }