Is is possible to make SEO friendly Url's in ASP.NET Core like this one
问题 I wanted to ask you guys if is it possible, to make some routing like this for my project /{action}/{title} ? I was wondering if that is possible, does this url has to be a primary key too? Since there is no ID passed to know which blog post is this. Thank you. 回答1: You can do this quite easily with attribute routing: [Route("blogs")] public class BlogController { [AcceptVerbs("GET", "HEAD", Route = "{slug}")] public IActionResult View(string slug) { } } This maps all requests to /blogs