public List <BlogPost> GetPostsWithStatus2() { var posts = _repo.GetDeletedBlogPosts(); 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); }