Odata and IAsyncEnumerable

Viewed 690

Our application API uses odata and before upgrading to .net core 3.1 (we used .net core 2.2), the odata query was able to handle large data sets(for grid exports) with no issues. But as of 3.1, we hit the IAsyncEnumerable buffer limit of 8192. What is the best work around for the buffer limit, increasing the limit isn't possible because the user could be exporting any number of records that could exceed the buffer size.

I did notice that the odata response is chunked, so I tried to read the response stream using JavaScript but that also causes the buffer exception to occur.

1 Answers

I encountered the same problem (OData / .Net Core 3.1 with Power BI Desktop as the client app).

Setting the page size on the controller method solved the problem for me :

[EnableQuery(PageSize = 100)]
public IActionResult Get()
{
    return Ok(AppDbContext.BiContracts.AsQueryable());
}
Related