Does ASP.NET MVC have a Decimal route constraint baked in?

355 Views Asked by At

Does ASP.NET MVC have a decimal route constraint baked into the core library?

I know there's the Regex Constraint but I was wondering if there's any others?

1

There are 1 best solutions below

0
On BEST ANSWER

I'm not aware of any, but it would be really easy to write your own. You just need to implement IRouteConstraint, which has a single Match method. Here is a blog post that explains it all in great detail.