title: Web API and OData- Pass Multiple Parameters
body: <p>Is it possible to get OData to do the following? I would like to be able to query a REST call by passing on parameters that may not be the primary key.
  Can I call a REST method like --&gt; <code>GetReports(22, 2014)</code> or <code>Reports(22, 2014)</code>?</p>
  <pre class="lang-cs prettyprint-override"><code>[HttpGet]
  [ODataRoute(&quot;Reports(Id={Id}, Year={Year})&quot;)]
  public IHttpActionResult GetReports([FromODataUri]int Id, [FromODataUri]int Year)
  {
      return Ok(_reportsRepository.GetReports(Id, Year));
  }
  </code></pre>
  <p><strong>Here is my latest change.</strong></p>
  <pre class="lang-cs prettyprint-override"><code>//Unbound Action  OData v3
  var action = builder.Action(&quot;ListReports&quot;);
  action.Parameter&lt;int&gt;(&quot;key&quot;);
  action.Parameter&lt;int&gt;(&quot;year&quot;);
  action.ReturnsCollectionFromEntitySet&lt;Report&gt;(&quot;Reports&quot;);
  </code></pre>
  <p><strong>my method for controller ReportsController</strong></p>
  <pre class="lang-cs prettyprint-override"><code>[HttpPost]
  [EnableQuery]
  public IHttpActionResult ListReports([FromODataUri] int key, ODataActionParameters parameters)
  {
      if (!ModelState.IsValid)
      {
          throw new HttpResponseException(HttpStatusCode.BadRequest);
      }
  
      int year = (int)parameters[&quot;year&quot;];
      
      return Ok(_reportsRepository.GetReports(key, year).Single());
  }
  </code></pre>
  <p><strong>I tried calling the url like:</strong></p>
  <pre><code>http://localhost:6064/odata/Reports(key=5,year=2014)/ListReports
  </code></pre>
  <p>No HTTP resource was found that matches the request URI '<code>http://localhost:6064/odata/Reports(key%3D5%2Cyear%3D2014)/ListReports'</code>.`</p>