Table of Contents

Class DataReaderExtensions

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

Extension methods for Data Readers.

[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>?, int, params IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, ArrayPool<object>?, CancellationToken)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, ArrayPool<object>?, CancellationToken, int, params IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, IEnumerable<int>, ArrayPool<object>?, CancellationToken)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, IEnumerable<int>, CancellationToken)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, int, params IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, CancellationToken)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsAsyncEnumerable(DbDataReader, CancellationToken, int, params IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsEnumerable(IDataReader)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsEnumerable(IDataReader, ArrayPool<object>?)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsEnumerable(IDataReader, ArrayPool<object>?, int, params IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsEnumerable(IDataReader, IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsEnumerable(IDataReader, IEnumerable<int>, ArrayPool<object>?)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

AsEnumerable(IDataReader, int, params IEnumerable<int>)

Provides an enumerable for iterating all the remaining values of the current result set of a data reader.

FirstOrdinalResults(IDataReader)

Reads the first column values from every record. DBNull values are then converted to null.

FirstOrdinalResultsAsync(DbDataReader, bool, CancellationToken)

Reads the first column values from every record. DBNull values are converted to null.

FirstOrdinalResultsAsync<T0>(DbDataReader, bool, CancellationToken)

Reads the first column values from every record. AnyDBNull values are then converted to null and casted to type T0;

FirstOrdinalResults<T0>(DbDataReader)

Reads the first column values from every record. AnyDBNull values are then converted to null and casted to type T0;

FirstOrdinalResults<T0>(IDataReader)

Reads the first column values from every record. AnyDBNull values are then converted to null and casted to type T0;

ForEach(IDataReader, Action<IDataRecord>, bool, CancellationToken)

Iterates all records from an IDataReader.

ForEach(IDataReader, Action<IDataRecord>, CancellationToken)

Iterates all records from an IDataReader.

ForEachAsync(DbDataReader, Action<IDataRecord>, bool, CancellationToken)

Iterates all records from an DbDataReader.

ForEachAsync(DbDataReader, Func<IDataRecord, ValueTask>, bool, CancellationToken)

Iterates all records from an DbDataReader.

ForEachAsync(DbDataReader, Func<IDataRecord, ValueTask>, CancellationToken)

Iterates all records from an DbDataReader.

IterateWhile(IDataReader, Func<IDataRecord, bool>, bool, CancellationToken)

Iterates an IDataReader while the predicate returns true.

IterateWhile(IDataReader, Func<IDataRecord, bool>, CancellationToken)

Iterates an IDataReader while the predicate returns true.

IterateWhileAsync(DbDataReader, Func<IDataRecord, bool>, bool, CancellationToken)

Iterates an IDataReader while the predicate returns true.

IterateWhileAsync(DbDataReader, Func<IDataRecord, bool>, CancellationToken)

Iterates an IDataReader while the predicate returns true.

IterateWhileAsync(IDataReader, Func<IDataRecord, ValueTask<bool>>, bool, CancellationToken)

Iterates an IDataReader while the predicate returns true.

IterateWhileAsync(IDataReader, Func<IDataRecord, ValueTask<bool>>, CancellationToken)

Iterates an IDataReader while the predicate returns true.

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

Asyncronously iterates all records from a data reader..]

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

Asyncronously iterates all records from a data reader..]

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

Asyncronously iterates all records from a data reader..]

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

Asyncronously iterates all records from a data reader..]

Select<T>(IDataReader, Func<IDataRecord, T>)

Iterates records from an IDataReader and passes the IDataRecord to a transform function.

Select<T>(IDataReader, Func<IDataRecord, T>, CancellationToken, bool)

Iterates records from an IDataReader and passes the IDataRecord to a transform function.

Select<T>(IDataReader, CancellationToken, Func<IDataRecord, T>, bool)

Iterates records from an IDataReader and passes the IDataRecord to a transform function.

ToArray<T>(IDataReader, Func<IDataRecord, T>)

Shortcut for .Select(transform).ToArray();

ToDataTable(IDataReader)

Loads all remaining data from an IDataReader into a DataTable.

ToDataTables(IDataReader)

Loads all data from a command through an IDataReader into a DataTables. Calls .NextResult() to check for more results.

ToImmutableArray<T>(IDataReader, Func<IDataRecord, T>)

Shortcut for .Select(transform).ToImmutableArray();

ToListAsync<T>(DbDataReader, Func<IDataRecord, ValueTask<T>>, CancellationToken)

Asynchronously iterates all records using the data reader and returns the desired results as a list.

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

Asynchronously iterates all records using the data reader and returns the desired results as a list.

ToList<T>(IDataReader, Func<IDataRecord, T>, CancellationToken)

Shortcut for .Iterate(transform).ToList();