예제 #1
0
        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));
        }
예제 #2
0
        public ActionResult ViewPending()
        {
            BlogManager manager  = BlogManagerFactory.Create();
            var         blogRoll = manager.GetAllPending();

            var blogRollVM = new BlogRollVM();

            blogRollVM.SetBlogRoll(blogRoll);

            return(View(blogRollVM));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #6
0
        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));
        }