❔ What does the "required" constraint do in route templates?
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-7.0#route-templates says the "required" constraint "Used to enforce that a non-parameter value is present during URL generation." I don't know what that means and can't seem to find any information about it.
Routing in ASP.NET Core
Discover how ASP.NET Core routing is responsible for matching HTTP requests and dispatching to executable endpoints.
3 Replies
it means that something in the url before '?' must be present
(parameters being the name/value things after "?")
But you can just do
{name}
and it is still required?Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.