Table of Contents

Method SelectAsync

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

SelectAsync<T>(DbDataReader, Func<IDataRecord, T>, bool, CancellationToken)

Asyncronously iterates all records from a data reader..]

public static IAsyncEnumerable<T> SelectAsync<T>(this DbDataReader reader, Func<IDataRecord, T> transform, bool throwOnCancellation, CancellationToken cancellationToken = default)

Parameters

reader DbDataReader

The DbDataReader to iterate.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

throwOnCancellation bool

If true, when canceled, may exit the iteration via an exception. Otherwise when canceled will simply stop iterating and return without exception.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncEnumerable<T>

An enumerable used to iterate the results.

Type Parameters

T

The return type of the transform function.

SelectAsync<T>(DbDataReader, Func<IDataRecord, T>, CancellationToken)

Asyncronously iterates all records from a data reader..]

public static IAsyncEnumerable<T> SelectAsync<T>(this DbDataReader reader, Func<IDataRecord, T> transform, CancellationToken cancellationToken = default)

Parameters

reader DbDataReader

The DbDataReader to iterate.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncEnumerable<T>

An enumerable used to iterate the results.

Type Parameters

T

The return type of the transform function.

SelectAsync<T>(IDataReader, Func<IDataRecord, ValueTask<T>>, bool, CancellationToken)

Asyncronously iterates all records from a data reader..]

public static IAsyncEnumerable<T> SelectAsync<T>(this IDataReader reader, Func<IDataRecord, ValueTask<T>> transform, bool throwOnCancellation, CancellationToken cancellationToken = default)

Parameters

reader IDataReader

The DbDataReader to iterate.

transform Func<IDataRecord, ValueTask<T>>

The transform function to process each IDataRecord.

throwOnCancellation bool

If true, when canceled, may exit the iteration via an exception. Otherwise when canceled will simply stop iterating and return without exception.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncEnumerable<T>

An enumerable used to iterate the results.

Type Parameters

T

The return type of the transform function.

SelectAsync<T>(IDataReader, Func<IDataRecord, ValueTask<T>>, CancellationToken)

Asyncronously iterates all records from a data reader..]

public static IAsyncEnumerable<T> SelectAsync<T>(this IDataReader reader, Func<IDataRecord, ValueTask<T>> transform, CancellationToken cancellationToken = default)

Parameters

reader IDataReader

The DbDataReader to iterate.

transform Func<IDataRecord, ValueTask<T>>

The transform function to process each IDataRecord.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncEnumerable<T>

An enumerable used to iterate the results.

Type Parameters

T

The return type of the transform function.