예제 #1
0
 private ActionResult GetPosts(PostLinkViewModel model, IList <Post> posts, PostsViewModel postsViewModel)
 {
     if (IsSinglePost(model, posts))
     {
         postsViewModel.ShowComments = true;
     }
     postsViewModel.AddPosts(posts);
     return(View("Show", postsViewModel));
 }
예제 #2
0
        public virtual ActionResult Index(string nickname)
        {
            var postsViewModel = new PostsViewModel {
                Nickname = nickname
            };
            IList <Post> posts = _postService.GetBlogPosts(nickname);

            postsViewModel.AddPosts(posts);
            return(View(postsViewModel));
        }
예제 #3
0
        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));
        }