Exemplo n.º 1
0
        public PartialViewResult FillWidgetWithData()
        {
            AllBlogPostsVM result = new AllBlogPostsVM();

            result.AllBlogPosts  = _blogServices.GetAllBlogPosts();
            result.AllCategories = _blogServices.GetAllCategories();
            result.AllTags       = _blogServices.GetAllTags();

            return(PartialView("~/Views/Shared/_BlogWidgetPartial.cshtml", result));
        }
Exemplo n.º 2
0
        public ActionResult AdminPanel()
        {
            AdminPanelVM model = new AdminPanelVM();

            model.Users       = _blogServices.GetAllUsers();
            model.Categories  = _blogServices.GetAllCategories();
            model.StaticPages = _staticPageServices.GetAllStaticPages();
            model.BlogPosts   = _blogServices.GetAllBlogPosts();

            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult Index(int?page)
        {
            List <BlogPost> allBlogPosts = _blogServices.GetAllBlogPosts();

            return(View(allBlogPosts.ToPagedList(pageNumber: page ?? 1, pageSize: 5)));
        }