title: WebApi 2.0 Routes not matching with query parameters?
body: <p>I've just switched from AttributeRouting to WebApi 2.0 AttributeRouting, and have got a controller and action defined like so:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class InvitesController : ApiController
  {
      [Route("~/api/invites/{email}")]
      [HttpGet]
      [ResponseType(typeof(string))]
      public IHttpActionResult InviteByEmail(string email)
      {
          return this.Ok(string.Empty);
      }
  }
  </code></pre>
  
  <p>Example query:</p>
  
  <pre><code>GET: http://localhost/api/invites/test@foo.com
  </code></pre>
  
  <p>The response I receive is a 200, with empty content (due to string.Empty).</p>
  
  <hr>
  
  <p>This all works fine -- but I want to change the email property to be a query parameter instead .  So I update the controller to:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class InvitesController : ApiController
  {
      [Route("~/api/invites")]
      [HttpGet]
      [ResponseType(typeof(string))]
      public IHttpActionResult InviteByEmail(string email)
      {
          return this.Ok(string.Empty);
      }
  }
  </code></pre>
  
  <p>But now when querying the endpoint with:</p>
  
  <pre><code>GET: http://localhost/api/invites?email=test@foo.com
  </code></pre>
  
  <p>The response I receive is a 404:</p>
  
  <pre><code>{
  "message": "No HTTP resource was found that matches the request URI 'http://localhost/api/invites?email=test@foo.com'.",
  "messageDetail": "No route providing a controller name was found to match request URI 'http://localhost/api/invites?email=test@foo.com'"
  }
  </code></pre>
  
  <p>Does anyone know why it doesn't match the route when the parameter is swapped to a query parameter, rather than inline of the url ?</p>
  
  <hr>
  
  <p>As requested, WebApiConfig is defined like so:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public static void Register(HttpConfiguration config)
  {
      var jsonFormatter = config.Formatters.JsonFormatter;
      jsonFormatter.Indent = true;
      jsonFormatter.SerializerSettings.ContractResolver = new RemoveExternalContractResolver();
  
      config.MapHttpAttributeRoutes();
  }
  </code></pre>
  
  <hr>
  
  <p>Thanks !</p>