Method Select
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Select<T>(IDataReader, Func<IDataRecord, T>)
Iterates records from an IDataReader and passes the IDataRecord to a transform function.
public static IEnumerable<T> Select<T>(this IDataReader reader, Func<IDataRecord, T> transform)
Parameters
readerIDataReaderThe reader to iterate.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
Returns
- IEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe return type of the transform function.
Select<T>(IDataReader, Func<IDataRecord, T>, CancellationToken, bool)
Iterates records from an IDataReader and passes the IDataRecord to a transform function.
public static IEnumerable<T> Select<T>(this IDataReader reader, Func<IDataRecord, T> transform, CancellationToken cancellationToken, bool throwOnCancellation = false)
Parameters
readerIDataReaderThe reader to iterate.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
cancellationTokenCancellationTokenA cancellation token for stopping the iteration.
throwOnCancellationboolIf true, when canceled, may exit the iteration via an exception. Otherwise when canceled will simply stop iterating and return without exception.
Returns
- IEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe return type of the transform function.
Select<T>(IDataReader, CancellationToken, Func<IDataRecord, T>, bool)
Iterates records from an IDataReader and passes the IDataRecord to a transform function.
public static IEnumerable<T> Select<T>(this IDataReader reader, CancellationToken cancellationToken, Func<IDataRecord, T> transform, bool throwOnCancellation = false)
Parameters
readerIDataReaderThe reader to iterate.
cancellationTokenCancellationTokenA cancellation token for stopping the iteration.
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.
Returns
- IEnumerable<T>
An enumerable used to iterate the results.
Type Parameters
TThe return type of the transform function.