public IEnumerable <Comment> GetCommentsByUser(string userid) { var comments = from c in commentRepository.GetMany(c => c.Update.Goal.GoalType == false).OrderByDescending(c => c.CommentDate) join com in commentUserRepository.GetMany(cu => cu.UserId == userid) on c.CommentId equals com.CommentId select c; return(comments); }
public IEnumerable <int> GetCommentIdsByUser(string userId) { List <int> commentIds = new List <int>(); var commentUsers = _commentUserRepository.GetMany(c => c.UserId == userId); foreach (var item in commentUsers) { commentIds.Add(item.CommentId); } return(commentIds); }