I have route with connected action which retrieves blog post drom database and displays it.
routes.MapRoute(
name: "GetPostToShow",
template: "posts/{postId:int}",
defaults: new { controller = "Home", action = "GetPostToShow" },
constraints: new { httpMethod = new HttpMethodRouteConstraint(new string[] { "GET" }) });
Which results in url
https://localhost:44300/posts/2002
But I want it to look like this
https://localhost:44300/posts?postId=2002
So how I can implement it?