public IActionResult Index(string category) { var model = new BlogPostsViewModel(_blogPostsConfig) { PageOfBlogPosts = _blogPostsConfig.GetBlogPostsWithTag(category), Category = category }; return(View(model)); }
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)); }