msgraph-sdk-design icon indicating copy to clipboard operation
msgraph-sdk-design copied to clipboard

PageIterator<T> should return an IAsyncEnumerable<T>

Open Licantrop0 opened this issue 4 years ago • 5 comments

The current PageIterator implementation requires the caller to have a callback function to process the individual items in the list, and it's impossible to use the modern IAsyncEnumerable<T> pattern.

Please provide an overload to the CreatePageIterator function to return an IAsyncEnumerable<T> directly, without requiring the callback.

Licantrop0 avatar Dec 29 '20 18:12 Licantrop0

This could be a part of #37.

nikithauc avatar Dec 31 '20 23:12 nikithauc

@nikithauc What is the status of this issue? It would be very useful to have.

vadrsa avatar Mar 28 '23 13:03 vadrsa

@maisarissi / @andrueastman do you have an update?

Licantrop0 avatar Mar 28 '23 16:03 Licantrop0

+2 years later - doesn't it make sense to provide such a thing, or at least a workaround?

flq avatar Feb 27 '25 14:02 flq

I wrote my own extensions for this, feel free to copy: https://github.com/microsoftgraph/dotnet-aad-query-sample/blob/main/MsGraphSamples.Services/GraphExtensions.cs

Licantrop0 avatar Mar 04 '25 19:03 Licantrop0