public ActionResult MyBlogs() { UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext())); var user = userMgr.FindByName(User.Identity.Name); var blogRollVM = new BlogRollVM(); blogRollVM.SetBlogRoll(user.UserPosts); return(View(blogRollVM)); }
public ActionResult ViewPending() { BlogManager manager = BlogManagerFactory.Create(); var blogRoll = manager.GetAllPending(); var blogRollVM = new BlogRollVM(); blogRollVM.SetBlogRoll(blogRoll); return(View(blogRollVM)); }
public ActionResult ViewSearchResults(string searchTag) { BlogManager manager = BlogManagerFactory.Create(); var blogRoll = manager.GetSearchResults(searchTag); var approvedBlogs = blogRoll.Where(b => b.IsApproved == true).Where(d => d.PostDate <= DateTime.Now); var blogRollVM = new BlogRollVM(); blogRollVM.SetBlogRoll(approvedBlogs); return(View(blogRollVM)); }
public ActionResult Index() { BlogManager manager = BlogManagerFactory.Create(); var blogRollVM = new BlogRollVM(); var blogRoll = manager.GetAllBlogs(); var approvedBlogs = blogRoll.Where(a => a.IsApproved == true).Where(d => d.PostDate <= DateTime.Now); var blogWriters = manager.GetAllBloggers(); blogRollVM.SetBlogRoll(approvedBlogs); blogRollVM.SetUsers(blogWriters); return(View(blogRollVM)); }
public ActionResult GetAllBlogs() { BlogManager manager = BlogManagerFactory.Create(); var blogRoll = manager.GetAllBlogs(); UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext())); var users = userMgr.Users; var blogRollVM = new BlogRollVM(); blogRollVM.SetBlogRoll(blogRoll); blogRollVM.SetUsers(users); return(View(blogRollVM)); }
public ActionResult ViewSearchResults(string searchTag) { BlogManager manager = BlogManagerFactory.Create(); var blogRoll = manager.GetSearchResults(searchTag); var approvedBlogs = blogRoll.Where(a => a.IsApproved == true) .Where(d => d.PostDate <= DateTime.Now); UserManager <AppUser> userMgr = new UserManager <AppUser>(new UserStore <AppUser>(new TheCodingVineDbContext())); var users = userMgr.Users; var blogRollVM = new BlogRollVM(); blogRollVM.SetBlogRoll(approvedBlogs); blogRollVM.SetUsers(users); return(View(blogRollVM)); }