title: Web Api Method accepting string, int, alphanumeric
body: <p>I'm working on some Web Api methods and ran into a scenario where we are passing in three different type of parameters: Numbers, Strings, and Alphanumeric values.</p>
  
  <p>Here is my routing information:</p>
  
  <pre><code>string alphanumeric = @"^[a-zA-Z]+[a-zA-Z0-9,_ -]*$";
  string numeric = @"^\d+$";
  
  config.Routes.MapHttpRoute(
     name: "DefaultApiControllerActionName",
     routeTemplate: "api/{controller}/{action}/{name}",
     defaults: null,
     constraints: new { action = alphanumeric }
  );
  
  config.Routes.MapHttpRoute(
     name: "DefaultApiControllerActionId",
     routeTemplate: "api/{controller}/{action}/{id}",
     defaults: null,
     constraints: new { action = alphanumeric, id = numeric }
  );
  </code></pre>
  
  <p>With this route info I can get either strings and alphanumeric values but not numbers (through the same method). Here is my code: </p>
  
  <pre><code>public IEnumerable&lt;Deliveries&gt; GetByAdvanced(string name)
  {
      var deliveries = ...
  
      return deliveries;
  }
  </code></pre>
  
  <p>e.g. Example Web API Urls</p>
  
  <ul>
  <li>Works  <a href="http://localhost:64288/Api/Deliveries/GetByAdvanced/Hello" rel="nofollow">http://localhost:64288/Api/Deliveries/GetByAdvanced/Hello</a></li>
  <li>Works  <a href="http://localhost:64288/Api/Deliveries/GetByAdvanced/ab12345" rel="nofollow">http://localhost:64288/Api/Deliveries/GetByAdvanced/ab12345</a></li>
  <li>Failed  <a href="http://localhost:64288/Api/Deliveries/GetByAdvanced/12345" rel="nofollow">http://localhost:64288/Api/Deliveries/GetByAdvanced/12345</a></li>
  </ul>
  
  <p>Now if I add another method just to handle the int value it works perfectly fine. e.g. the code below</p>
  
  <pre><code>public IEnumerable&lt;Deliveries&gt; GetByAdvanced(int id)
  {
      var deliveries = ...
  
      return deliveries;
  }
  </code></pre>
  
  <p>Is this the correct way accept these values?</p>