Ejemplo n.º 1
0
        //
        // GET: /Blog/

        // Show a list of blog for this user only, this will be a dashboard screen for the user
        public ActionResult Index(int id = 0, int catagoryId = 0)
        {
            if (catagoryId == 0)
            {
                ViewData["Message"] = "Showing a list of all blogs";
            }
            else
            {
                ViewData["Message"] = string.Format("Blogs under Category: {0}", UnitOfWork_.CategoryRepo.GetCategoryById(catagoryId).CategoryName);
            }

            IQueryable<Blogs> blogs = UnitOfWork_.BlogRepo.GetBlogs(catagoryId);

            PaginatedViewBlogList paginatedList = new PaginatedViewBlogList(blogs, id, 5);

            return View(paginatedList);
        }
Ejemplo n.º 2
0
        //
        // GET: /Blog/

        // Show a list of blog for this user only, this will be a dashboard screen for the user
        public ActionResult Index(int id = 0, int catagoryId = 0)
        {
            if (catagoryId == 0)
            {
                ViewData["Message"] = "Showing a list of all blogs";
            }
            else
            {
                ViewData["Message"] = string.Format("Blogs under Category: {0}", UnitOfWork_.CategoryRepo.GetCategoryById(catagoryId).CategoryName);
            }

            IQueryable <Blogs> blogs = UnitOfWork_.BlogRepo.GetBlogs(catagoryId);

            PaginatedViewBlogList paginatedList = new PaginatedViewBlogList(blogs, id, 5);

            return(View(paginatedList));
        }