WebApi icon indicating copy to clipboard operation
WebApi copied to clipboard

Implement support for IAsyncEnumerable

Open rossbuggins opened this issue 7 years ago • 9 comments

Should odata support IAsyncEnumerable? There is an open work item on asp.net core https://github.com/aspnet/AspNetCore/issues/5357 and the underlying c# support https://github.com/dotnet/corefx/issues/32640

rossbuggins avatar Jan 29 '19 08:01 rossbuggins

@rossbuggins Are you referring to APIs at the ODL level or the WebAPI level. Can you please add more details? For the time being, we are assuming this is for WebAPI.

KanishManuja-MS avatar Feb 06 '19 21:02 KanishManuja-MS

Note that Ix Async will be releasing a preview of the LINQ operators for this shortly.

clairernovotny avatar Feb 19 '19 20:02 clairernovotny

@KanishManuja-MS I can't speak for @rossbuggins but now that IAsyncEnumerable is out in the wild, I think the best ask would be to support allowing controllers to return an IAsyncEnumerable<T> implementation (or Task<IAsyncEnumerable<T>>).

This would probably require a change in the TypeHelper class here:

https://github.com/OData/WebApi/blob/9e447bd77d177cf4cd1e285c318ffc3185a34c12/src/Microsoft.AspNet.OData.Shared/TypeHelper.cs#L269

To allow the IsCollection method to recognize IAsyncEnumerable<T>.

Additional work would have to be done in the outputformatters/serializers to support async/Task changes when iterating over said IAsyncEnumerable<T>.

The current implementation iterates over the non-generic IEnumerable; a conditional branch there would probably have to be checked to see if there is something assignable to IAsyncEnumerable<object> or IEnumerable and then iterate appropriately.

casperOne avatar Oct 03 '19 12:10 casperOne

What is the best approach to deal with MaxIAsyncEnumerableBufferLimit in odata?

aladdinhussein avatar Mar 19 '20 18:03 aladdinhussein

Any plan to add support for IAsyncEnumerable to Odata?

darraghjones avatar Dec 07 '21 00:12 darraghjones

Is there any plan to implement this ?

medboz avatar Nov 15 '22 11:11 medboz

Any news on this one?

LucasVos avatar Jan 18 '23 14:01 LucasVos

Also interested in this feature

jwevans avatar Jul 10 '23 10:07 jwevans

also interested

dominicnguyenwt avatar Aug 29 '23 10:08 dominicnguyenwt