Exemplo n.º 1
0
        public async Task <IActionResult> Gallery()
        {
            var viewModel = new GalleryInListViewModel
            {
                Photos = await this.galleryService.GetAllAsync <GalleryViewModel>(),
            };

            return(this.View(viewModel));
        }
Exemplo n.º 2
0
        // GET: Administration/Galleries
        public async Task <IActionResult> Index(int id = 1)
        {
            if (id <= 0)
            {
                return(this.NotFound());
            }

            const int itemsPerPage = 6;

            var viewModel = new GalleryInListViewModel
            {
                PageNumber   = id,
                ItemsPerPage = itemsPerPage,
                ItemsCount   = this.galleryService.GetCount(),
                Photos       = await this.galleryService.GetAllWithDeletedAsync <GalleryViewModel>(id),
            };

            return(this.View(viewModel));
        }