示例#1
0
        public IActionResult ViewPictures(int?p)
        {
            int page = PageChecks(p, "ViewPictures");

            var allPictures = picturesService.GetAllPictures();

            ViewBag.TotalLinksToDisplay = GetLinksCountFor(allPictures.Count());
            ViewBag.CurrentPage         = page;

            int toSkip = GetPaginationDataToSkip(page);

            var picturesList = allPictures.Skip(toSkip).Take(MaxMediaPerPage).To <AdministrationPicturesViewModel>().ToList();

            return(View(picturesList));
        }
示例#2
0
        public IActionResult Pictures(int?p)
        {
            int page = PageChecks(p, "Pictures");

            var allPics = picturesService.GetAllPictures();

            var picsList = allPics
                           .Skip(GetSkipCount(allPics.Count(), page))
                           .Take(MaxMediaPerPage).To <PicturesViewModel>()
                           .ToList();

            return(View(picsList));
        }