Exemplo n.º 1
0
        public ActionResult ListSinglePost(int id)
        {
            // Added a new view in order to view the whole post without the truncation from dotdotdot.
            // Also for viewing comments
            var ops = new BlogPostOperations();
            //var vm = new HomeIndexViewModel();
            var vm = new ListSinglePostViewModel();
            vm.BlogPost = ops.GetPostByID(id).FirstOrDefault();
            vm.Categories = ops.GetAllCategories();
            vm.StaticPages = ops.GetAllStaticPages();
            //vm.RouteID = ; can we use this to go back to the right routed page on the home index?

            return View(vm);
        }
Exemplo n.º 2
0
        public ActionResult EditPost(int id)
        {
            var ops = new BlogPostOperations();
            var vm = new EditPostViewModel(ops.GetAllCategories());
            vm.BlogPost = ops.GetPostByID(id).FirstOrDefault();

            return View(vm);
        }