Update ListOneDriveFolder to use IAsyncEnumerable pagination#25
Merged
Conversation
- ListFolderAsync now returns IAsyncEnumerable<BlobMetadata> that automatically follows NextLink across all pages - Replace manual page.Value/page.NextLink with await foreach pattern - Bump SDK to 0.6.0-preview.1.dev (local build with pagination support) - Add local NuGet source for pre-release validation Depends on: Azure/Connectors-NET-SDK#70 Co-authored-by: Dobby <dobby@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Updates the DirectConnector OneDrive sample to demonstrate the SDK’s new IAsyncEnumerable<T>-based pagination pattern for listing folder contents.
Changes:
- Refactors
ListOneDriveFoldertoawait foreachoverListFolderAsync(...)and automatically traverse all pages. - Bumps the
Microsoft.Azure.Connectors.Sdkpackage reference to a.devpre-release build. - Adds a temporary local NuGet package source to enable restore against the local SDK build.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| NuGet.config | Adds a local package source intended to supply a dev SDK build for pagination. |
| DirectConnector/OneDriveFunctions.cs | Switches folder listing to IAsyncEnumerable<T> enumeration to follow pagination automatically. |
| DirectConnector/DirectConnector.csproj | Updates the Connectors SDK package version to a dev pre-release build. |
- New GetChannelMessages function uses await foreach to iterate Teams channel messages across all pages automatically - Validated E2E: 37 messages returned across 2 pages (20 + 17) from live Teams connector with automatic NextLink following Co-authored-by: Dobby <dobby@microsoft.com>
Reverts function code to pre-pagination pattern so CI builds with the currently published SDK (0.6.0-preview.1). The pagination samples (await foreach on ListFolderAsync, GetChannelMessages) will be re-added after SDK v0.7.0-preview.1 is published. Co-authored-by: Dobby <dobby@microsoft.com>
…ource" This reverts commit a0833e9.
…source Co-authored-by: Dobby <dobby@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the
ListOneDriveFoldersample function to demonstrate the newIAsyncEnumerable<T>pagination pattern from the SDK.Depends on: Azure/Connectors-NET-SDK#70 (SDK pagination PR)
What Changed
OneDriveFunctions.cs—ListOneDriveFolderBefore (manual page handling):
After (automatic pagination):
DirectConnector.csproj0.6.0-preview.1.dev(local build with pagination)NuGet.configMerge Plan
v0.7.0-preview.1)Local Validation
Compiled and validated against the local SDK build with pagination support.