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
readerDbDataReaderThe DbDataReader to iterate.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
throwOnCancellationboolIf true, when canceled, may exit the iteration via an exception. Otherwise when canceled will simply stop iterating and return without exception.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe 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
readerDbDataReaderThe DbDataReader to iterate.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe 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
readerIDataReaderThe DbDataReader to iterate.
transformFunc<IDataRecord, ValueTask<T>>The transform function to process each IDataRecord.
throwOnCancellationboolIf true, when canceled, may exit the iteration via an exception. Otherwise when canceled will simply stop iterating and return without exception.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe 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
readerIDataReaderThe DbDataReader to iterate.
transformFunc<IDataRecord, ValueTask<T>>The transform function to process each IDataRecord.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe return type of the transform function.