Web Api route constraint tuples <p>I have a route like this:</p> <pre><code>config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{tenantParam1}/{tenantParam2}/{controller}/{id}, constraints: ???, defaults: new { id = RouteParameter.Optional } ); </code></pre> <p>For tenantParam1, and tenantParam2, I need to constrain them so that only certain tuples of values are allowed. Is there a way to do that?</p> <p>Edit: to clarify, the important part is that I need to evaluate tenantParam1 and tenantParam2 together, as a tuple. For instance, lets say these are my valid tenants:</p> <pre><code>param1 | param2 ABC | 123 ABC | 456 DEF | 789 DEF | 012 </code></pre> <p>That would mean the following routes are valid:</p> <pre><code>/api/ABC/123 /api/ABC/456 /api/DEF/789 /api/DEF/012 </code></pre> <p>But the following routes are not valid:</p> <pre><code>/api/ABC/789 /api/ABC/012 /api/DEF/123 /api/DEF/456 </code></pre>