Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ASP.NET MVC – example of RequiredRouteConstraint (:required) use

$
0
0

I am not sure about RequiredRouteConstraint use. The definition sais“Constraints a route parameter that must have a value.” and”This constraint is primarily used to enforce that a non-parameter value is present during URL generation.”.

The route normally without parameter specified would not be matched if it is not optional parameter or if the default route not comply this case. So appending:required constraint to route parameter (e.g. {name:required}) seems useless to me.

How does look like example of RequiredRouteConstraint common use?


Viewing all articles
Browse latest Browse all 9386

Trending Articles