msgraph-sdk-dotnet-core icon indicating copy to clipboard operation
msgraph-sdk-dotnet-core copied to clipboard

Create PageIterator for HttpRequestMessage with @odata.nextlink

Open MIchaelMainer opened this issue 6 years ago • 1 comments

Related to #15

Create a PageIterator that takes an HttpRequestMessage and HttpClient (ideally from the GraphClientFactory), along with the delegate, to handle paging without using the *Request and *RequestBuilder classes.

 new PageIterator(HttpRequestMessage, HttpClient, Func< bool>) 

AB#7192

MIchaelMainer avatar Jul 12 '19 18:07 MIchaelMainer

When using the service library, we know the type expected in the collection of items returned in the response. This allows the developer to pass a delegate to process each of the items (intrapage iteration). We can enqueue/dequeue each item in the page and make it available to the delegate.

Without the service library, we can't know what the HttpResponseMessage.Content holds. This means the developer has to setup intrapage iteration in their delegate - we aren't providing this value (like we did for the service library). So, this leaves us with interpage iteration. We could iterate and queue HttpResponseMessage objects so that the customer defined intrapage iteration in their delegate can handle each HttpResponseMessage. We can make iteration resumeable in case of deltalink or if delegate stopped processing the content of an HttpResponseMessage (returned false).

MIchaelMainer avatar Sep 05 '19 22:09 MIchaelMainer

closing this as it's older and don't think we've seen requests for this recently.

ddyett avatar Jun 29 '23 01:06 ddyett