public ActionResult FavoriteShops(int p = 1) { UserModel userModel = new UserModel(); UserInfo userInfo = userModel.GetUserInfo(User.Identity.Name); var favoriteShops = userModel.GetUserFavoriteShops(userInfo.Id); int favCount = favoriteShops.Count(); ViewBag.FavoriteShopsCount = favCount; int pageSize = 16; Paging.ToPaging(p, favCount, this, pageSize); favoriteShops = favoriteShops.Skip((p - 1) * pageSize).Take(pageSize); ViewBag.PageName = "favshop"; return View(favoriteShops); }