title: How might I simultaneously bind FromQuery and FromRoute parameter?
body: <p>I am needing to simultaneously support a query-parameter based route (<code>/api/models?id=1</code>) and a route based one (<code>/api/models/1</code>) while still allowing unambiguous access to the models collection (<code>/api/models</code>)?</p>
  
  <p>My controller looks (something) like this:</p>
  
  <pre><code>[Route("/api/{controller}")]
  public class ModelsController : Controller
  {
      [HttpGet]
      public Models[] GetModels([FromQuery]QueryOptions queryOptions)
      {
          //...
      }    
  
      [HttpGet("{id:int}")]
      public Model Get([FromRoute] int id)
      {
          //...
      }
  
      [HttpGet("?{id:int}")]
      public Model Get2Try1([FromQuery] int id)
      {
         //Fails with ": The literal section '?' is invalid. 
         //Literal sections cannot contain the '?' character."
         //Which makes sense after some reading...
      }
  
      [HttpGet]
      public Model Get2Try2([FromQuery] int id)
      {
         //Fails with "AmbiguousActionException: Multiple actions matched. 
         //The following actions matched route data and had all constraints satisfied: 
         //GetModels and Get2Try2"
         //Which I think I understand as well...the absence of optional params
         //means ambiguous routing...
      }
  
      [HttpGet] //What here?
      public Model Get2Try3([FromQuery] int id) //and/or here?
      {
  
      }
  }
  </code></pre>
  
  <p>I feel like there should be some way to (with declarative routing) accomplish this. Has anyone done anything along these lines?</p>
  
  <p>Also, current code base is ASP.NET Core (RC1) to be upgraded to RTM/1.0 shortly. Details on either side are likely similar, but am interested in either/both.</p>