Ejemplo n.º 1
0
        public async Task <IActionResult> Index(GetStoriesRequest request)
        {
            var storiesPage = await _blogStoryManager.GetPageAsync(request.ToQuery(PageSize), Cancel);

            var viewModel = new AuthorStoriesPageViewModel(storiesPage, request.Page, PageSize);

            return(View(viewModel));
        }
Ejemplo n.º 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)));
        }