//Pagination public ActionResult Index(int page = 1) { PhotoPageInfo pageInfo = new PhotoPageInfo { PageNumber = page, PageSize = ImagesOnPage, Tag = string.Empty, TotalItems = photoService.CountByTag(string.Empty) }; IEnumerable <PhotoViewModel> photos = photoService.GetAll(0, ImagesOnPage * page) .Select(p => p.ToPhotoViewModel()); return(View(new PaginationViewModel <PhotoViewModel> { PageInfo = pageInfo, Items = photos })); }