Table of Contents

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

command IExecuteReader

The IExecuteReader to iterate.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

Returns

T

The value from the transform.

Type Parameters

T

The return type of the transform function.