Skip to content

Update ListOneDriveFolder to use IAsyncEnumerable pagination#25

Merged
daviburg merged 5 commits into
mainfrom
feature/pagination-sample
May 1, 2026
Merged

Update ListOneDriveFolder to use IAsyncEnumerable pagination#25
daviburg merged 5 commits into
mainfrom
feature/pagination-sample

Conversation

@daviburg
Copy link
Copy Markdown
Member

Summary

Updates the ListOneDriveFolder sample function to demonstrate the new IAsyncEnumerable<T> pagination pattern from the SDK.

Depends on: Azure/Connectors-NET-SDK#70 (SDK pagination PR)

What Changed

OneDriveFunctions.csListOneDriveFolder

Before (manual page handling):

var page = await client.ListFolderAsync(folderId, cancellationToken);
// Only first page, NextLink ignored

After (automatic pagination):

await foreach (var file in client.ListFolderAsync(folderId)
    .WithCancellation(cancellationToken)
    .ConfigureAwait(continueOnCapturedContext: false))
{
    // All items across all pages, automatically
}

DirectConnector.csproj

  • SDK version bumped to 0.6.0-preview.1.dev (local build with pagination)

NuGet.config

  • Temporary local NuGet source for pre-release validation
  • TODO: Remove once SDK is published to nuget.org

Merge Plan

  1. Merge SDK PR Add IAsyncEnumerable pagination support (#58) Connectors-NET-SDK#70
  2. Tag and publish new SDK NuGet package (e.g. v0.7.0-preview.1)
  3. Update this PR: set SDK version to published version, remove local NuGet source
  4. Merge this PR

Local Validation

Compiled and validated against the local SDK build with pagination support.

- 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>
Copilot AI review requested due to automatic review settings April 29, 2026 05:45
@daviburg daviburg requested a review from a team as a code owner April 29, 2026 05:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ListOneDriveFolder to await foreach over ListFolderAsync(...) and automatically traverse all pages.
  • Bumps the Microsoft.Azure.Connectors.Sdk package reference to a .dev pre-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.

Comment thread NuGet.config Outdated
Comment thread DirectConnector/DirectConnector.csproj Outdated
Comment thread DirectConnector/OneDriveFunctions.cs
- 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>
@daviburg daviburg marked this pull request as draft April 29, 2026 18:39
@daviburg daviburg marked this pull request as ready for review April 29, 2026 18:40
@daviburg daviburg marked this pull request as draft April 29, 2026 18:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@daviburg daviburg marked this pull request as ready for review May 1, 2026 00:50
Copilot AI review requested due to automatic review settings May 1, 2026 00:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

Comment thread DirectConnector/OneDriveFunctions.cs
Comment thread DirectConnector/ConnectorFunctions.cs
Comment thread DirectConnector/ConnectorFunctions.cs
Comment thread DirectConnector/ConnectorFunctions.cs
Comment thread DirectConnector/ConnectorFunctions.cs
@daviburg daviburg merged commit 4b8f335 into main May 1, 2026
11 checks passed
@daviburg daviburg deleted the feature/pagination-sample branch May 1, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants