title: Custom Routing with ASP.NET Web API
body: <p>Suppose that I have a nested <em>one to many</em>-type hierarchy database as follows:</p>
  
  <p>One <strong>Region</strong> has many <strong>Countries</strong>; each <strong>Country</strong> has many <strong>Cities</strong>; a <strong>City</strong> must belong to <em>one and only one</em> country.</p>
  
  <p>Abstracting this information into a RDBMS is a trivial exercise, but (to my mind) the most sensible REST endpoint to return a list of countries for a <strong>given region id</strong> would be something like the following:</p>
  
  <pre><code>HTTP GET http://localhost/Region/3/Countries
  </code></pre>
  
  <p>By default, the .NET Web API's routing would be, at best, <code>http://localhost/Countries/Region/3</code> or <code>http://localhost/Region/Countries/3</code>.</p>
  
  <p>Is there a sensible naming-convention I should follow, or is the routing customisable enough to allow URIs to take any shape I like?</p>