Table of Contents

Method Take

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

Take<T>(IDbCommand, int, Func<IDataRecord, T>, CommandBehavior)

Iterates an IDataReader and returns the first number of results defined by the count.

public static List<T> Take<T>(this IDbCommand command, int count, Func<IDataRecord, T> transform, CommandBehavior behavior = CommandBehavior.Default)

Parameters

command IDbCommand

The IDbCommand to generate a reader from.

count int

The maximum number of records to return.

transform Func<IDataRecord, T>

The transform function to process each IDataRecord.

behavior CommandBehavior

The behavior to use with the data reader.

Returns

List<T>

The results from the transform limited by the take count.

Type Parameters

T

The return type of the transform function.