title: ASP.NET Core 3.1 OData PageResult Serialization
body: <p>The <code>PageResult</code> response is missing the <code>nextPageLink</code> and <code>count</code> values when being serialized through <code>System.Text.Json</code> (ASP.NET Core 3 default) for the following result:</p>
  <pre class="lang-cs prettyprint-override"><code>[ApiController]
  [Route(&quot;api/[controller]&quot;)]
  public class ValuesController : ControllerBase
  {
    [HttpGet]
    public IActionResult Get()
    {
      var items = new List&lt;string&gt; { &quot;value&quot; };
  
      var pageResult = new Microsoft.AspNet.OData.PageResult&lt;string&gt;(items, new Uri(&quot;http://localhost/foo&quot;), items.Count);
  
      return Ok(pageResult);
    }
  }
  </code></pre>
  <p>However when I use the <a href="https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/formatting?view=aspnetcore-3.0#add-newtonsoftjson-based-json-format-support" rel="nofollow noreferrer"><code>Newtonsoft.Json</code> formatter</a>, the result is correct:</p>
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services)
  {
    services.AddControllers().AddNewtonsoftJson();
  }
  </code></pre>
  <p>Result with <code>System.Text.Json</code>:</p>
  <pre><code>[
      &quot;value&quot;
  ]
  </code></pre>
  <p>Result with <code>Newtonsoft.Json</code>:</p>
  <pre><code>{
      &quot;items&quot;: [
          &quot;value&quot;
      ],
      &quot;nextPageLink&quot;: &quot;http://localhost/foo&quot;,
      &quot;count&quot;: 1
  }
  </code></pre>
  <p>Any idea what the reason is for this behaviour?</p>