Exemplo n.º 1
0
        public List <BlogPost> GetPostsWithStatus0()
        {
            var posts = _repo.GetBlogPostsByPR();

            foreach (var post in posts)
            {
                post.CategoryName = _repo.GetCategoryByPostID(post.PostID);
                post.BlogTags     = new List <Tag>();
                var tagList = _repo.GetTagsByPostID(post.PostID);
                if (tagList != null)
                {
                    foreach (var tag in tagList)
                    {
                        post.BlogTags.Add(tag);
                    }
                }
            }
            return(posts);
        }