Table of Contents

Interface IRowReaderFactory

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Creates row readers over a prepared query command and exposes them as enumerables. The enumerable members are default implementations built on the two reader factories; a provider may override GetEnumerable<TResult>(IPreparedQueryCommand<TResult>, params object[]?) when its readers already implement IEnumerable<T> (the in-memory context does, to skip the compiler-generated iterator state machine).

public interface IRowReaderFactory
Extension Methods

Methods

CreateAsyncEnumerator<TResult>(IPreparedQueryCommand<TResult>, object[]?, CancellationToken)

Creates an asynchronous enumerator that reads the rows of a compiled query.

IAsyncEnumerator<TResult> CreateAsyncEnumerator<TResult>(IPreparedQueryCommand<TResult> preparedQueryCommand, object[]? @params, CancellationToken cancellationToken)

Parameters

preparedQueryCommand IPreparedQueryCommand<TResult>

The compiled query to read.

params object[]

The positional parameter values bound to the query, or null for none.

cancellationToken CancellationToken

Cancels opening and enumeration of the reader.

Returns

IAsyncEnumerator<TResult>

An asynchronous enumerator over the result rows.

Type Parameters

TResult

The result element type.

CreateEnumeratorAsync<TResult>(IPreparedQueryCommand<TResult>, object[]?, CancellationToken)

Creates a synchronous enumerator, awaiting the asynchronous reader initialization first.

Task<IEnumerator<TResult>> CreateEnumeratorAsync<TResult>(IPreparedQueryCommand<TResult> preparedQueryCommand, object[]? @params, CancellationToken cancellationToken)

Parameters

preparedQueryCommand IPreparedQueryCommand<TResult>

The compiled query to read.

params object[]

The positional parameter values bound to the query, or null for none.

cancellationToken CancellationToken

Cancels the initialization of the reader.

Returns

Task<IEnumerator<TResult>>

A task producing a synchronous enumerator over the result rows.

Type Parameters

TResult

The result element type.

CreateEnumerator<TResult>(IPreparedQueryCommand<TResult>, object[]?)

Creates a synchronous enumerator that reads the rows of a compiled query.

IEnumerator<TResult> CreateEnumerator<TResult>(IPreparedQueryCommand<TResult> preparedQueryCommand, object[]? @params)

Parameters

preparedQueryCommand IPreparedQueryCommand<TResult>

The compiled query to read.

params object[]

The positional parameter values bound to the query, or null for none.

Returns

IEnumerator<TResult>

A synchronous enumerator over the result rows.

Type Parameters

TResult

The result element type.

GetAsyncEnumerable<TResult>(IPreparedQueryCommand<TResult>, params object[])

Wraps the rows of a compiled query in an asynchronous sequence using None.

IAsyncEnumerable<TResult> GetAsyncEnumerable<TResult>(IPreparedQueryCommand<TResult> preparedCommand, params object[] @params)

Parameters

preparedCommand IPreparedQueryCommand<TResult>

The compiled query to read.

params object[]

The positional parameter values bound to the query.

Returns

IAsyncEnumerable<TResult>

An asynchronous sequence over the result rows.

Type Parameters

TResult

The result element type.

GetAsyncEnumerable<TResult>(IPreparedQueryCommand<TResult>, CancellationToken, params object[])

Wraps the rows of a compiled query in an asynchronous sequence, honouring a cancellation token.

IAsyncEnumerable<TResult> GetAsyncEnumerable<TResult>(IPreparedQueryCommand<TResult> preparedCommand, CancellationToken cancellationToken, params object[] @params)

Parameters

preparedCommand IPreparedQueryCommand<TResult>

The compiled query to read.

cancellationToken CancellationToken

Cancels opening and enumeration of the reader.

params object[]

The positional parameter values bound to the query.

Returns

IAsyncEnumerable<TResult>

An asynchronous sequence over the result rows.

Type Parameters

TResult

The result element type.

GetEnumerable<TResult>(IPreparedQueryCommand<TResult>, params object[]?)

Wraps the rows of a compiled query in a synchronous sequence. Overridden by providers whose readers already implement IEnumerable<T>, to skip the iterator state machine.

IEnumerable<TResult> GetEnumerable<TResult>(IPreparedQueryCommand<TResult> preparedCommand, params object[]? @params)

Parameters

preparedCommand IPreparedQueryCommand<TResult>

The compiled query to read.

params object[]

The positional parameter values bound to the query, or null for none.

Returns

IEnumerable<TResult>

A synchronous sequence over the result rows.

Type Parameters

TResult

The result element type.