public ActionResult Index(int page = 1, int kategori = 0) { int pageSize = 5; var urun = _urunService.GetByKategori(kategori); UrunListViewModel model = new UrunListViewModel { Urunler = urun.Skip((page - 1) * pageSize).Take(pageSize).ToList(), PageCount = (int)Math.Ceiling(urun.Count / (double)pageSize), PageSize = pageSize, CurrentKategori = kategori, CurrentPage = page }; return(View(model)); }