title: Where does WebAPI 2.2 OData v4 [EnableQuery] apply?
body: <p>Where is it correct/incorrect to apply the EnableQueryAttribute as of Jan 2015?</p>
  
  <p>The document linked below:</p>
  
  <p><a href="http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint" rel="noreferrer">http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint</a></p>
  
  <p>Says:</p>
  
  <blockquote>
    <p>The [EnableQuery] attribute enables clients to modify the query, by using query options such as $filter, $sort, and $page. For more information, see Supporting OData Query Options.</p>
  </blockquote>
  
  <p>The following linked document:</p>
  
  <p><a href="http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options" rel="noreferrer">http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options</a></p>
  
  <p>Says:</p>
  
  <blockquote>
    <p>The EnableQuerySupport method enables query options globally for any controller action that returns an IQueryable type.</p>
  </blockquote>
  
  <p>But this document for OData 4 on WebApi 2.2 has put it on actions returning IHttpActionResult:</p>
  
  <p><a href="http://blogs.msdn.com/b/webdev/archive/2014/03/13/getting-started-with-asp-net-web-api-2-2-for-odata-v4-0.aspx" rel="noreferrer">http://blogs.msdn.com/b/webdev/archive/2014/03/13/getting-started-with-asp-net-web-api-2-2-for-odata-v4-0.aspx</a></p>
  
  <pre><code>[ODataRoutePrefix("Teams")]
  public class TeamsEntitySetController : ODataController
  {
      private readonly LeageContext _leage = new LeageContext();
  
      [EnableQuery]
      [ODataRoute]
      public IHttpActionResult GetFeed()
      {
          return Ok(_leage.Teams);
      }
      [ODataRoute("({id})")]
      [EnableQuery]
      public IHttpActionResult GetEntity(int id)
      {
          return Ok(SingleResult.Create&lt;Team&gt;(_leage.Teams.Where(t =&gt; t.Id == id)));
      }
  }
  </code></pre>
  
  <p>I'm going crazy trying to find up-to-date, accurate and consistent documentation on OData v4 / WebApi 2.2.</p>
  
  <p>Which is correct today?</p>