// GET: Category public ActionResult Index(int?page) { IEnumerable <SelectItemViewModel> categoriesList = new List <SelectItemViewModel>(); categoriesList = _recipeProvider.GetSelectCategories(); ViewBag.CategoryId = new SelectList(categoriesList, "Id", "Name"); var model = _recipeProvider.GetRecipes().OrderBy(i => i.Id); int pageSize = 10; int pageNumber = (page ?? 1); return(View(_recipeProvider.GetRecipes().OrderByDescending(i => i.Id).ToPagedList(pageNumber, pageSize))); //return View(_recipeProvider.GetRecipes().OrderBy(i => i.Id)); }