Table of Contents

Method ToArray

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

ToArray<T>(IExecuteReader, Func<IDataRecord, T>, CommandBehavior)

Converts all IDataRecords into an array using a transform function.

public static T[] ToArray<T>(this IExecuteReader command, Func<IDataRecord, T> transform, CommandBehavior behavior = CommandBehavior.Default)

Parameters

command IExecuteReader

The IExecuteReader to iterate.

transform Func<IDataRecord, T>

The transform function.

behavior CommandBehavior

The command behavior for once the command the reader is complete.

Returns

T[]

The array of transformed records.

Type Parameters

T

The expected return type.