public ActionResult GetBlogPost(int id) { //TODO: check id is valid BlogPost existingPost = _blogServices.GetBlogPost(id); List <Category> allCategories = _blogServices.GetAllCategories(); var model = WebServices.ConvertBlogPostToVeiwModel(existingPost, allCategories); return(View(model)); }
public AllBlogPostsVM GetAllBlogPostsVM() { AllBlogPostsVM allBlogPosts = new AllBlogPostsVM(); allBlogPosts.AllBlogPosts = _blogServices.GetAllBlogPosts(); allBlogPosts.AllCategories = _blogServices.GetAllCategories(); allBlogPosts.AllTags = _blogServices.GetAllTags(); return(allBlogPosts); }
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)); }
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)); }