Reputation: 476
I saw in this article that I can pass parameter to certain built-in route constraint like minlength(value)
. How I can achieve the same behaviour with custom IRouteConstraint ?
Upvotes: 1
Views: 239
Reputation: 476
I found a solution: it seems that we simply need to pass this parameter in the constructor.
For exemple:
public class TestRouteConstraint : IRouteConstraint
{
public TestRouteConstraint(int parameter)
{
}
...
}
Upvotes: 1