Show / Hide Table of Contents

Class AsyncCollectionResult<T>

Represents a collection of values returned from a cloud service operation. The collection values may be delivered over one or more service responses.

Inheritance
System.Object
AsyncCollectionResult
AsyncCollectionResult<T>
Inherited Members
AsyncCollectionResult.GetContinuationToken(ClientResult)
AsyncCollectionResult.GetRawPagesAsync()
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.Nullable(0)]
[System.Runtime.CompilerServices.NullableContext(1)]
public abstract class AsyncCollectionResult<T> : System.ClientModel.Primitives.AsyncCollectionResult, System.Collections.Generic.IAsyncEnumerable<T>
Type Parameters
T

Constructors

AsyncCollectionResult<T>()

Creates a new instance of AsyncCollectionResult<T>.

Declaration
protected internal AsyncCollectionResult ();

Methods

GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

Declaration
[System.Runtime.CompilerServices.AsyncIteratorStateMachine(typeof(System.ClientModel.AsyncCollectionResult`1/<GetAsyncEnumerator>d__1))]
public System.Collections.Generic.IAsyncEnumerator<T> GetAsyncEnumerator (System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken that may be used to cancel the asynchronous iteration.

Returns
System.Collections.Generic.IAsyncEnumerator<T>

An enumerator that can be used to iterate asynchronously through the collection.

GetValuesFromPageAsync(ClientResult)

Gets a collection of the values returned in a page response.

Declaration
protected abstract System.Collections.Generic.IAsyncEnumerable<T> GetValuesFromPageAsync (System.ClientModel.ClientResult page);
Parameters
ClientResult page

The service response to obtain the values from.

Returns
System.Collections.Generic.IAsyncEnumerable<T>

A collection of T values read from the response content in page.

Remarks

This method does not take a System.Threading.CancellationToken parameter. AsyncCollectionResult<T> implementations must store the System.Threading.CancellationToken passed to the service method that creates them and pass that token to any async methods called from this method.

Back to top Azure SDK for .NET