Interface IRowReaderFactory
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
preparedQueryCommandIPreparedQueryCommand<TResult>The compiled query to read.
paramsobject[]The positional parameter values bound to the query, or null for none.
cancellationTokenCancellationTokenCancels opening and enumeration of the reader.
Returns
- IAsyncEnumerator<TResult>
An asynchronous enumerator over the result rows.
Type Parameters
TResultThe 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
preparedQueryCommandIPreparedQueryCommand<TResult>The compiled query to read.
paramsobject[]The positional parameter values bound to the query, or null for none.
cancellationTokenCancellationTokenCancels the initialization of the reader.
Returns
- Task<IEnumerator<TResult>>
A task producing a synchronous enumerator over the result rows.
Type Parameters
TResultThe 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
preparedQueryCommandIPreparedQueryCommand<TResult>The compiled query to read.
paramsobject[]The positional parameter values bound to the query, or null for none.
Returns
- IEnumerator<TResult>
A synchronous enumerator over the result rows.
Type Parameters
TResultThe 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
preparedCommandIPreparedQueryCommand<TResult>The compiled query to read.
paramsobject[]The positional parameter values bound to the query.
Returns
- IAsyncEnumerable<TResult>
An asynchronous sequence over the result rows.
Type Parameters
TResultThe 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
preparedCommandIPreparedQueryCommand<TResult>The compiled query to read.
cancellationTokenCancellationTokenCancels opening and enumeration of the reader.
paramsobject[]The positional parameter values bound to the query.
Returns
- IAsyncEnumerable<TResult>
An asynchronous sequence over the result rows.
Type Parameters
TResultThe 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
preparedCommandIPreparedQueryCommand<TResult>The compiled query to read.
paramsobject[]The positional parameter values bound to the query, or null for none.
Returns
- IEnumerable<TResult>
A synchronous sequence over the result rows.
Type Parameters
TResultThe result element type.