Table of Contents

Method ToImmutableArray

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

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

Converts all IDataRecords into an immutable array using a transform function.

public static ImmutableArray<T> ToImmutableArray<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

ImmutableArray<T>

The array of transformed records.

Type Parameters

T

The expected return type.