title: ASP.NET Core 6 ODATA Count not returning a value
body: <p>I have recently upgraded to <code>.NET 6 Core</code> Preview and I am experiencing some issues with ODATA. What use to work in <code>.NET Core 3.1</code> no longer works.</p>
  <p>Here is my Startup snippet:
  I also believe <code>EnableQueryFeatures()</code> allows for <code>Count</code> by default.</p>
  <pre><code>services.AddControllers().AddNewtonsoftJson(options =&gt;
      { 
          options.SerializerSettings.ContractResolver = new DefaultContractResolver();
      }).AddOData(opt =&gt; opt
            .EnableQueryFeatures()
            .AddRouteComponents(&quot;odata&quot;, GetEdmModel()
      );
  </code></pre>
  <p>I have the following Action Method and when called, the count is not returned
  to the front end.</p>
  <p>The <strong>pageResult holds a count value</strong>, but is not being returned to the front end,
  when I inspect the result using Chrome DevTools.</p>
  <pre><code>[Route(&quot;odata/Tasks&quot;)]
  public PageResult&lt;TaskModel&gt; AjaxListOData([FromQuery]ODataQueryOptions queryOptions)
  {            
      var result = queryOptions.ApplyTo(dataContext.Tasks) as IEnumerable&lt;TaskModel&gt;;
      var pageResult = new PageResult&lt;TaskModel&gt;(
      result,
      null,
      count: Request.ODataFeature().TotalCount);
  
      return pageResult;
  }
  </code></pre>