Ejemplo n.º 1
0
        public IList <Comment> GetCommentsByUserId(int id)
        {
            var            list        = this.GetAll();
            PostDataAccess postList    = new PostDataAccess();
            var            ListOfPosts = postList.GetPostsByUserId(id);

            return(list.Join(ListOfPosts, comment => comment.Id, post => post.Id, (comment, post) => comment).ToList());
        }
Ejemplo n.º 2
0
        public IList <Comment> GetCommentsByUserId(int id)
        {
            PostDataAccess postsl = new PostDataAccess();
            var            post   = postsl.GetPostsByUserId(id);
            var            list   = this.GetAll();
            var            result = from x in list
                                    join y in post on x.PostId equals y.Id
                                    select x;

            return(result.ToList());
        }