Class DataReaderExtensions
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Provides extension methods that read rows and result sets from an IDataReader or DbDataReader.
[SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Overload provided for convienience.")]
[SuppressMessage("Reliability", "CA2016:Forward the 'CancellationToken' parameter to methods that take one", Justification = "Intentional to prevent cancellation exception.")]
public static class DataReaderExtensions
- Inheritance
-
DataReaderExtensions
- Inherited Members
Methods
- AsAsyncEnumerable(DbDataReader, ArrayPool<object>?, CancellationToken)
Asynchronously enumerates the remaining records of the current result set of a DbDataReader as arrays of values; the reader's connection is held while each row is processed.
- AsAsyncEnumerable(DbDataReader, IEnumerable<int>, ArrayPool<object>?, CancellationToken)
Asynchronously enumerates the remaining records of the current result set of a DbDataReader as arrays of values; the reader's connection is held while each row is processed.
- AsAsyncEnumerable(DbDataReader, IEnumerable<int>, CancellationToken)
Asynchronously enumerates the remaining records of the current result set of a DbDataReader as arrays of values; the reader's connection is held while each row is processed.
- AsAsyncEnumerable(DbDataReader, CancellationToken)
Asynchronously enumerates the remaining records of the current result set of a DbDataReader as arrays of values; the reader's connection is held while each row is processed.
- ForEach(IDataReader, Action<IDataRecord>, CancellationToken)
Calls a handler for each remaining record of the current result set of an IDataReader; the reader's connection is held while each row is processed.
- ForEachAsync(DbDataReader, Action<IDataRecord>, bool, CancellationToken)
Asynchronously calls a handler for each remaining record of the current result set of a DbDataReader; the reader's connection is held while each row is processed.
- ForEachAsync(DbDataReader, Action<IDataRecord>, CancellationToken)
Asynchronously calls a handler for each remaining record of the current result set of a DbDataReader; the reader's connection is held while each row is processed.
- ForEachAsync(DbDataReader, Func<IDataRecord, ValueTask>, bool, CancellationToken)
Asynchronously calls a handler for each remaining record of the current result set of a DbDataReader; the reader's connection is held while each row is processed.
- ForEachAsync(DbDataReader, Func<IDataRecord, ValueTask>, CancellationToken)
Asynchronously calls a handler for each remaining record of the current result set of a DbDataReader; the reader's connection is held while each row is processed.
- IterateWhile(IDataReader, Func<IDataRecord, bool>, CancellationToken)
Iterates the remaining records of the current result set of an IDataReader while a predicate returns true; the reader's connection is held while each row is processed.
- IterateWhileAsync(DbDataReader, Func<IDataRecord, bool>, bool, CancellationToken)
Asynchronously iterates the remaining records of the current result set of a DbDataReader while a predicate returns true; the reader's connection is held while each row is processed.
- IterateWhileAsync(DbDataReader, Func<IDataRecord, bool>, CancellationToken)
Asynchronously iterates the remaining records of the current result set of a DbDataReader while a predicate returns true; the reader's connection is held while each row is processed.
- IterateWhileAsync(IDataReader, Func<IDataRecord, ValueTask<bool>>, bool, CancellationToken)
Asynchronously iterates the remaining records of the current result set of an IDataReader while an asynchronous predicate returns true; the reader's connection is held while each row is processed.
- IterateWhileAsync(IDataReader, Func<IDataRecord, ValueTask<bool>>, CancellationToken)
Asynchronously iterates the remaining records of the current result set of an IDataReader while an asynchronous predicate returns true; the reader's connection is held while each row is processed.
- SelectAsync<T>(DbDataReader, Func<IDataRecord, T>, CancellationToken)
Asynchronously and lazily transforms each remaining record of a DbDataReader through a function.
- SelectAsync<T>(IDataReader, Func<IDataRecord, ValueTask<T>>, CancellationToken)
Asynchronously and lazily transforms each remaining record of an IDataReader through an asynchronous function; the reader's connection is held while each row is processed.
- Select<T>(IDataReader, Func<IDataRecord, T>)
Lazily transforms each remaining record of an IDataReader through a function.
- Select<T>(IDataReader, Func<IDataRecord, T>, CancellationToken)
Lazily transforms each remaining record of an IDataReader through a function.
- Select<T>(IDataReader, CancellationToken, Func<IDataRecord, T>)
Lazily transforms each remaining record of an IDataReader through a function.
- ToDataTable(IDataReader)
Loads the current result set of an IDataReader into a DataTable.
- ToDataTables(IDataReader)
Loads every result set of an IDataReader, from the current one on, into its own DataTable.
- ToListAsync<T>(DbDataReader, Func<IDataRecord, ValueTask<T>>, CancellationToken)
Asynchronously iterates the remaining records of the current result set and returns the results of an asynchronous transform as a list.