title: $inlinecount not working on ApiController using ApplyTo
body: <p>I'm trying to use the OData filtering and paging capabilities in a standard Web API 2.2 <code>ApiController</code>. For this, I have to rewrite the request URL to conform to the OData v4 standards. My controller looks like this:</p>
  
  <pre><code>public GridPage Get([FromUri] GridSearchCriteria criteria)
  {
      Request.RequestUri = ... // convert querystring to OData v4
      var context = new ODataQueryContext(MyEdmModel.Instance, typeof(Delivery), null);
      ODataQueryOptions&lt;Delivery&gt; options = new ODataQueryOptions&lt;Delivery&gt;(context, Request);
  
      IQueryable&lt;Delivery&gt; deliveries = ... // use EF to load deliveries from DB
      var result = (IQueryable&lt;Delivery&gt;)options.ApplyTo(deliveries); // BTW, I wonder why there is no generic overload of ApplyTo?
  
      // fill and return a GridPage
      ...
  }
  </code></pre>
  
  <p>So far everything works nice as expected.</p>
  
  <p>Now, I'm interested in the total count of the filtered items and thus I've added <code>$inlinecount=allpages</code> to the query string. The resulting request URI looks like this:</p>
  
  <p><code>http://localhost:54026/.../deliveries/page?$top=10&amp;$skip=0&amp;$inlinecount=allpages}</code></p>
  
  <p>Then, I'm trying to retrieve the total count like this (after the call to <code>ApplyTo</code>):</p>
  
  <pre><code>long? totalCount = Request.ODataProperties().TotalCount;
  </code></pre>
  
  <p>Unfortunately, <code>totalCount</code> always stays null no matter what I try. I've also tried using:</p>
  
  <pre><code>object totalCount;
  Request.Properties.TryGetValue("System.Web.OData.TotalCount", out totalCount);
  </code></pre>
  
  <p>but no luck. A peek into the <code>Request</code> properties reveals that there is an entry under <code>System.Web.OData.Properties</code> but all its properties are uninitialized (<code>Model</code> is null, <code>NextLink</code> is null, <code>TotalCount</code> is null, etc.). </p>
  
  <p>Does anybody have an idea why this isn't working? BTW, I'm using <code>Microsoft.AspNet.OData</code> v5.6.</p>