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
commandIDbCommandThe IDbCommand to generate a reader from.
countintThe maximum number of records to return.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
behaviorCommandBehaviorThe behavior to use with the data reader.
Returns
- List<T>
The results from the transform limited by the take count.
Type Parameters
TThe return type of the transform function.