Implement support for IAsyncEnumerable
Should odata support IAsyncEnumerable? As when we use applyto on the server for example EntityFramework context.
Then we need to remap the data if there has been use of a select query.
Would it then be usefull to use IAsyncEnumerable to map and stream the data to the client at the samen time?
@danielpastoor just to check whether I understand your request:
You want to be able to return an IAsyncEnumerable from a controller action and have support that the same way it does for IEnumerable (i.e. query processing with EnableQuery, OData result serialization, etc.), right?
Yes that is right
Ideally it would work the same as returning IQueryable where the select, filter etc applies to the returned results. And if there are no results post OData filtering then send nothing. This would be useful for streaming data changes, where the client decides how they want their data filtered/shaped.
I do think this would only support a subset though, as things like aggregations wouldn't make sense.
It is already implemented in the asp.net core variant: https://github.com/OData/AspNetCoreOData/commit/fa81478df06c1fa16007ea43a47288cad2fd978a