public ActionResult Review(int id) { BlogManager manager = BlogManagerFactory.Create(); BlogPost toReview = manager.GetBlog(id); foreach (var tag in toReview.SearchTags) { if (toReview.TagInputs == null) { toReview.TagInputs = tag.SearchTagBody; } else { toReview.TagInputs = (toReview.TagInputs + "," + tag.SearchTagBody); } } UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext())); var users = userMgr.Users; var blogVM = new BlogVM(); blogVM.SetBlog(toReview); blogVM.SetBlogWriters(users); return(View(blogVM)); }
public ActionResult EditABlog(int id) { BlogManager manager = BlogManagerFactory.Create(); var blogToEdit = manager.GetBlog(id); UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext())); var users = userMgr.Users; foreach (var tag in blogToEdit.SearchTags) { if (blogToEdit.TagInputs == null) { blogToEdit.TagInputs = tag.SearchTagBody; } else { blogToEdit.TagInputs = (blogToEdit.TagInputs + "," + tag.SearchTagBody); } } var blogVM = new BlogVM(); blogVM.SetBlog(blogToEdit); blogVM.SetBlogWriters(users); return(View(blogVM)); }
public ActionResult AddBlogPost() { BlogPost blog = new BlogPost(); var blogVM = new BlogVM(); blogVM.SetBlog(blog); return(View(blogVM)); }
public ActionResult DeleteABlog(int id) { BlogManager manager = BlogManagerFactory.Create(); var blog = manager.GetBlog(id); BlogVM blogVM = new BlogVM(); blogVM.SetBlog(blog); return(View(blogVM)); }
public ActionResult ViewSingleAll(int id) { BlogManager manager = BlogManagerFactory.Create(); var blog = manager.GetBlog(id); UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext())); var users = userMgr.Users; var blogVM = new BlogVM(); blogVM.SetBlog(blog); blogVM.SetBlogWriters(users); return(View(blogVM)); }