示例#1
0
        public async Task <IActionResult> Index([FromQuery] Int32 page = 1)
        {
            var storiesPage = await _blogStoryManager.GetPageWithTagsAsync(GetStoriesRequest.ToPublishedQuery(page, PageSize), Cancel);

            var topTags = await _tagManager.GetTopPublishedAsync(Cancel);

            return(View("IndexPub", new MainPageViewModel(storiesPage,
                                                          topTags,
                                                          page)));
        }
示例#2
0
        public async Task <IActionResult> Tags([FromRoute] String alias,
                                               [FromQuery] Int32 page = 1)
        {
            var tag = await _tagManager.GetAsync(alias, Cancel);

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

            var storiesByTag = await _blogStoryManager.GetPageWithTagsAsync(GetStoriesRequest.ToQuery(tag.Id, page, PageSize));

            var topTags = await _tagManager.GetTopPublishedAsync(Cancel);

            ViewBag.Title           = tag.SeoTitle;
            ViewBag.Description     = tag.SeoDescription;
            ViewBag.Keywords        = tag.SeoKeywords;
            ViewBag.NoFollowForTags = true;

            return(View("~/Views/BlogStory/IndexPub.cshtml",
                        new MainPageViewModel(storiesByTag,
                                              topTags,
                                              page)));
        }