Method Single
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Single<T>(IExecuteReader, Func<IDataRecord, T>)
Iterates a IDataReader and returns the first result through a transform function. Throws if none or more than one entry.
public static T Single<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.