Пример #1
0
        public List <CommentDto> GetCommentsByCurrentUser()
        {
            var result = new List <CommentDto>();
            var getCommentsByCurretUser = _commentDal.GetCommentListWithPostInformation(x => x.UserId == _customUserService.GetCurrentUser().Id);

            foreach (var item in getCommentsByCurretUser)
            {
                var dtoComment = new CommentDto
                {
                    CommentDate = item.CommentDate,
                    Content     = item.Content,
                    IsActive    = item.IsActive,
                    Id          = item.Id,
                    PostId      = item.PostId,
                    UserId      = item.UserId
                };
            }


            return(result);
        }
Пример #2
0
 public List <Comment> GetCommentsByCurrentUser()
 {
     return(_commentDal.GetCommentListWithPostInformation(x => x.UserId == _customUserService.GetCurrentUser().Id));
 }