Method First
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
First<T>(IExecuteReader, Func<IDataRecord, T>)
Iterates an IDataReader and returns the first result through a transform function. Throws if none.
public static T First<T>(this IExecuteReader command, Func<IDataRecord, T> transform)
Parameters
commandIExecuteReaderThe IExecuteReader to iterate.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
Returns
- T
The value from the transform.
Type Parameters
TThe return type of the transform function.