private ActionResult GetPosts(PostLinkViewModel model, IList <Post> posts, PostsViewModel postsViewModel) { if (IsSinglePost(model, posts)) { postsViewModel.ShowComments = true; } postsViewModel.AddPosts(posts); return(View("Show", postsViewModel)); }
public virtual ActionResult Index(string nickname) { var postsViewModel = new PostsViewModel { Nickname = nickname }; IList <Post> posts = _postService.GetBlogPosts(nickname); postsViewModel.AddPosts(posts); return(View(postsViewModel)); }
public virtual ActionResult Index(AdminBlogViewModel model) { var blog = _blogService.GetBlog(model.Nickname); IList <Post> posts = _postService.GetOrderedBlogPosts(blog.Id); var postsViewModel = new PostsViewModel { Nickname = model.Nickname }; postsViewModel.AddPosts(posts); return(View(postsViewModel)); }