title: Listing page always returned a exception for asking provide id
body: <p>I'm using ASP.NET MVC + WEB API 2, with self host.</p>
  
  <p>This is my self host Startup.cs:</p>
  
  <pre><code>public class SelfHostStartup
  {
      // This code configures Web API. The Startup class is specified as a type
      // parameter in the WebApp.Start method.
      public void Configuration(IAppBuilder appBuilder)
      {
          // Configure Web API for self-host. 
          var config = new HttpConfiguration();
          // Web API configuration and services
          // Configure Web API to use only bearer token authentication.
          config.SuppressDefaultHostAuthentication();
          config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
          ConfigureAuth(appBuilder);
  
          // Web API routes
          config.MapHttpAttributeRoutes();
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = UrlParameter.Optional }
          );
  
          appBuilder.UseWebApi(config);
      }
  }
  </code></pre>
  
  <p>already specified the <code>id</code> is optional, but when accessing url:</p>
  
  <blockquote>
    <p><a href="http://localhost:9000/api/MyTransactionModels/" rel="nofollow">http://localhost:9000/api/MyTransactionModels/</a></p>
  </blockquote>
  
  <p>always prompt error:</p>
  
  <blockquote>
    <p>The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Threading.Tasks.Task`1[System.Web.Http.IHttpActionResult] GetMyTransactionModels(Int32)' in 'MyTest.Controllers.MyTransactionModelsController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.</p>
  </blockquote>
  
  <p>this is the Controller:</p>
  
  <pre><code>public class MyTransactionModelsController : ApiController
  {
      private ApplicationDbContext db = new ApplicationDbContext();
  
      // GET: api/MyTransactionModels
      [Authorize]
      public IQueryable&lt;MyTransactionModel&gt; GetMyTransactionModels()
      {
          return db.MyTransactionModels;
      }
  
      // GET: api/MyTransactionModels/5
      [ResponseType(typeof(MyTransactionModel))]
      public async Task&lt;IHttpActionResult&gt; GetMyTransactionModels(int id)
      {
          ...
      }
  }
  </code></pre>
  
  <p>While testing result is correct with the <code>detail</code> page by url:</p>
  
  <blockquote>
    <p><a href="http://localhost:9000/api/MyTransactionModels/1" rel="nofollow">http://localhost:9000/api/MyTransactionModels/1</a></p>
  </blockquote>
  
  <p>anyone could help?</p>