Exemple #1
0
        public async Task <IActionResult> OnGetAsync(long id, string?slug, [FromQuery] int page = 1)
        {
            Tag = await _tagsRepo.GetTag(id);

            if (Tag == null)
            {
                return(NotFound());
            }

            Stories = await _storiesRepo.GetCardsWithTag(id, page, PerPage);

            // Prepare pagination
            Pagination = new Pagination
            {
                CurrentPage = page,
                ItemCount   = await _storiesRepo.CountWithTag(id),
                PerPage     = PerPage
            };

            return(Page());
        }