AsyncPageable<T> クラス

定義

反復処理するために複数のサービス要求を受け取る可能性がある値のコレクション。

public abstract class AsyncPageable<T> : System.Collections.Generic.IAsyncEnumerable<T>
type AsyncPageable<'T> = class
    interface IAsyncEnumerable<'T>
Public MustInherit Class AsyncPageable(Of T)
Implements IAsyncEnumerable(Of T)

型パラメーター

T

値の型。

継承
AsyncPageable<T>
実装

ループを使用して AsyncPageable を列挙する async foreach 例:

// call a service method, which returns AsyncPageable<T>
AsyncPageable<SecretProperties> allSecretProperties = client.GetPropertiesOfSecretsAsync();

await foreach (SecretProperties secretProperties in allSecretProperties)
{
    Console.WriteLine(secretProperties.Name);
}

または while ループを使用します。

// call a service method, which returns AsyncPageable<T>
AsyncPageable<SecretProperties> allSecretProperties = client.GetPropertiesOfSecretsAsync();

IAsyncEnumerator<SecretProperties> enumerator = allSecretProperties.GetAsyncEnumerator();
try
{
    while (await enumerator.MoveNextAsync())
    {
        SecretProperties secretProperties = enumerator.Current;
        Console.WriteLine(secretProperties.Name);
    }
}
finally
{
    await enumerator.DisposeAsync();
}

コンストラクター

AsyncPageable<T>()

モック作成のために クラスの AsyncPageable<T> 新しいインスタンスを初期化します。

AsyncPageable<T>(CancellationToken)

AsyncPageable<T> クラスの新しいインスタンスを初期化します。

プロパティ

CancellationToken

非同期的な CancellationToken 列挙中に行われた要求に使用される を取得します。

メソッド

AsPages(String, Nullable<Int32>)

一度に 値 を Page<T> 列挙します。 これにより、複数のサービス要求が行われる可能性があります。

FromPages(IEnumerable<Page<T>>)

指定されたページを使用して の Pageable<T> インスタンスを作成します。

GetAsyncEnumerator(CancellationToken)

コレクション内の値を非同期的に列挙します。 これにより、複数のサービス要求が行われる可能性があります。

適用対象