Method ToArray
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ToArray<T>(IDbCommand, CommandBehavior, Func<IDataRecord, T>)
Iterates all records using an IDataReader and returns the desired results as an array.
public static T[] ToArray<T>(this IDbCommand command, CommandBehavior behavior, Func<IDataRecord, T> transform)
Parameters
commandIDbCommandThe IDbCommand to generate a reader from.
behaviorCommandBehaviorThe behavior to use with the data reader.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
Returns
- T[]
Type Parameters
TThe return type of the transform function.
ToArray<T>(IDbCommand, Func<IDataRecord, T>, CommandBehavior)
Iterates all records using an IDataReader and returns the desired results as an array.
public static T[] ToArray<T>(this IDbCommand command, Func<IDataRecord, T> transform, CommandBehavior behavior = CommandBehavior.Default)
Parameters
commandIDbCommandThe IDbCommand to generate a reader from.
transformFunc<IDataRecord, T>The transform function to process each IDataRecord.
behaviorCommandBehaviorThe behavior to use with the data reader.
Returns
- T[]
Type Parameters
TThe return type of the transform function.