Ejemplo n.º 1
0
        public IActionResult Index(string category)
        {
            var model = new BlogPostsViewModel(_blogPostsConfig)
            {
                PageOfBlogPosts = _blogPostsConfig.GetBlogPostsWithTag(category),
                Category        = category
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public IActionResult Index(string tag)
        {
            if (string.IsNullOrEmpty(tag))
            {
                return(Redirect("~/tags"));
            }

            var model = new BlogPostsViewModel(_blogPostsConfig)
            {
                PageOfBlogPosts = _blogPostsConfig.GetBlogPostsWithTag(tag),
                Tag             = tag
            };

            return(View(model));
        }