title: web api routing
body: <p>I have the following url:</p>
  
  <p>localhost/api/machine/somecode/all</p>
  
  <p>I have the following controller:</p>
  
  <pre><code> public class MachineController : ApiController
  {
      public IEnumerable&lt;Machine&gt; Get()
      {
          return new List&lt;Machine&gt;
                     {
                         new Machine
                             {
                                 LastPlayed = DateTime.UtcNow,
                                 MachineAlertCount = 1,
                                 MachineId = "122",
                                 MachineName = "test",
                                 MachinePosition = "12",
                                 MachineStatus = "test"
                             }
                     };
      }
  
      public IEnumerable&lt;Machine&gt; All(string code)
      {
          return new List&lt;Machine&gt;
                     {
                         new Machine
                             {
                                 LastPlayed = DateTime.UtcNow,
                                 MachineAlertCount = 1,
                                 MachineId = "122",
                                 MachineName = "test",
                                 MachinePosition = "12",
                                 MachineStatus = "test"
                             }
                     };
      }
  }
  </code></pre>
  
  <p>and the following routes:</p>
  
  <pre><code>public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          config.Routes.MapHttpRoute(
            name: "MachineApi",
            routeTemplate: "api/machine/{code}/all"
        );
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
  
      }
  }
  </code></pre>
  
  <p>but for some reason it's not resolving - any glaringly obvious reason why?</p>