title: WebAPI GET optional integer parameters
body: <p>Can someone help me fill in the blanks with my GET methods for webapi.  I want to pass in no parameters and get all results.  Pass in an int and get a single result and pass in a named parameter to filter by a typeId / zoneId or both but am struggling to get this to work.</p>
  
  <pre><code>TimeController : ApiController
  
  // Time/  
  
  //Time/1
  
  //Time/typeId=1
  
  //Time/zoneId=1
  
  Time/typeId=1&amp;zoneId=1
  </code></pre>
  
  <p>The closest I got was with</p>
  
  <p>Global</p>
  
  <pre><code>  RouteTable.Routes.MapHttpRoute(name: "DefaultApi",
             routeTemplate: "api/{controller}/{id}",
             defaults: new { id = System.Web.Http.RouteParameter.Optional}
             );
  
          RouteTable.Routes.MapHttpRoute(name: "TemplateTimeApi",
             routeTemplate: "api/{controller}/{typeId}/{zoneId}",
             defaults: new {typeId = RouteParameter.Optional, zoneId = RouteParameter.Optional }
             );
  </code></pre>
  
  <p>Controller </p>
  
  <pre><code> List&lt;TimeView&gt; Get(int typeId, int? zoneId = null)
  
   TimeView Get(int id)
  </code></pre>
  
  <p>but I get a 404 on no parameters.</p>
  
  <p>I can change one of the parameters to a string if the issue is with two integers, however, I would prefer to understand the issue and get it to work.</p>