Table of Contents

Method GetAsyncEnumerator

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

GetAsyncEnumerator(CancellationToken)

Returns an async enumerator that reads and yields one untyped Result per row from the underlying database reader, enabling await foreach (Result row in reader).

public IAsyncEnumerator<Result> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the underlying ReadAsync calls.

Returns

IAsyncEnumerator<Result>

A forward-only, single-pass IAsyncEnumerator<T> backed by the live database reader.

Remarks

Rows are fetched lazily and without blocking a thread while waiting on I/O: each call to MoveNextAsync() advances the underlying DbDataReader via ReadAsync(CancellationToken). Because iteration reads directly from the connected reader, this enumerator can only be used once and must be consumed before the enclosing await using (ResultReader ...) block exits.