public ActionResult Index(int?page) { int userId = GetUserId(); using (var collectService = new CollectsService()) { var collections = collectService.AllCollectList(userId).Where(i => i.RecipientId != userId).OrderByDescending(i => i.DateOfAdd).ToList(); int pageSize = 5; int pageNumber = (page ?? 1); return(View(collections.ToPagedList(pageNumber, pageSize))); //return View(collections); } }