Table of Contents

Method Read

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

Read(Action<IEnumerable<T>>)

Passes the rows of the current result set to the handler.

public void Read(Action<IEnumerable<T>> handler)

Parameters

handler Action<IEnumerable<T>>

Receives the rows, which are read as it enumerates them.

Remarks

The rows are read from the reader as the handler enumerates them, and the reader is in use until the handler returns. For rows held in memory use ToList().

Read<TResult>(Func<IEnumerable<T>, TResult>)

Passes the rows of the current result set to the handler and returns its result.

public TResult Read<TResult>(Func<IEnumerable<T>, TResult> handler)

Parameters

handler Func<IEnumerable<T>, TResult>

Receives the rows, which are read as it enumerates them.

Returns

TResult

The value the handler returns.

Type Parameters

TResult

The type the handler returns.

Remarks

The rows are read from the reader as the handler enumerates them, and the reader is in use until the handler returns. For rows held in memory use ToList().