Table of Contents

Class EnumerableTypeParserMaker

Namespace
Rinku.Mapping.Defaults
Assembly
Rinku.dll

Creates parsers for IEnumerable<T> results. The returned sequence runs the query as it is enumerated. An asynchronous query opens the reader asynchronously before returning the sequence. Use an asynchronous stream when every row must be read asynchronously.

public sealed class EnumerableTypeParserMaker : ReusingBaseTypeParserMaker, ITypeParserMaker
Inheritance
EnumerableTypeParserMaker
Implements
Inherited Members
Extension Methods

Constructors

EnumerableTypeParserMaker()

Creates parsers for IEnumerable<T> results. The returned sequence runs the query as it is enumerated. An asynchronous query opens the reader asynchronously before returning the sequence. Use an asynchronous stream when every row must be read asynchronously.

public EnumerableTypeParserMaker()

Methods

TryColdStart(Type, DbCommand, ICacheGivingParser, bool, out object?)

Tries to run T before the returned columns are known. Return false when a parser must be created after the reader opens.

public bool TryColdStart(Type type, DbCommand cmd, ICacheGivingParser cache, bool disposeCommand, out object? result)

Parameters

type Type
cmd DbCommand

The command to run, not yet run.

cache ICacheGivingParser

Turns the reader's columns into the parser for T.

disposeCommand bool

Whether the command is this run's to dispose.

result object

The result, when this maker took the run.

Returns

bool

Remarks

Use this for a deferred result that must open the reader while it is consumed. Return false for buffered results or when the columns must be known first.

TryColdStart(Type, IDbCommand, ICacheGivingParser, bool, out object?)

Tries to run T before the returned columns are known. Return false when a parser must be created after the reader opens.

public bool TryColdStart(Type type, IDbCommand cmd, ICacheGivingParser cache, bool disposeCommand, out object? result)

Parameters

type Type
cmd IDbCommand

The command to run, not yet run.

cache ICacheGivingParser

Turns the reader's columns into the parser for T.

disposeCommand bool

Whether the command is this run's to dispose.

result object

The result, when this maker took the run.

Returns

bool

Remarks

Use this for a deferred result that must open the reader while it is consumed. Return false for buffered results or when the columns must be known first.

TryColdStartAsync(Type, DbCommand, ICacheGivingParser, bool, CancellationToken, out Task<object?>?)

Attempts to produce a deferred object result for a runtime result type.

public bool TryColdStartAsync(Type type, DbCommand cmd, ICacheGivingParser cache, bool disposeCommand, CancellationToken ct, out Task<object?>? result)

Parameters

type Type
cmd DbCommand
cache ICacheGivingParser
disposeCommand bool
ct CancellationToken
result Task<object>

Returns

bool

TryColdStartAsync(Type, IDbCommand, ICacheGivingParser, bool, CancellationToken, out Task<object?>?)

Attempts to produce a deferred object result for a runtime result type.

public bool TryColdStartAsync(Type type, IDbCommand cmd, ICacheGivingParser cache, bool disposeCommand, CancellationToken ct, out Task<object?>? result)

Parameters

type Type
cmd IDbCommand
cache ICacheGivingParser
disposeCommand bool
ct CancellationToken
result Task<object>

Returns

bool

TryColdStartAsync<T>(DbCommand, ICacheGivingParser<T>, bool, CancellationToken, out Task<T>)

public bool TryColdStartAsync<T>(DbCommand cmd, ICacheGivingParser<T> cache, bool disposeCommand, CancellationToken ct, out Task<T> result)

Parameters

cmd DbCommand

The command to run, not yet run.

cache ICacheGivingParser<T>

Turns the reader's columns into the parser for T.

disposeCommand bool

Whether the command is this run's to dispose.

ct CancellationToken

The token the caller is running under.

result Task<T>

The result, when this maker took the run.

Returns

bool

Type Parameters

T

Remarks

Return a completed task when no asynchronous work is needed. The synchronous and asynchronous methods may accept different result types.

TryColdStartAsync<T>(IDbCommand, ICacheGivingParser<T>, bool, CancellationToken, out Task<T>)

public bool TryColdStartAsync<T>(IDbCommand cmd, ICacheGivingParser<T> cache, bool disposeCommand, CancellationToken ct, out Task<T> result)

Parameters

cmd IDbCommand

The command to run, not yet run.

cache ICacheGivingParser<T>

Turns the reader's columns into the parser for T.

disposeCommand bool

Whether the command is this run's to dispose.

ct CancellationToken

The token the caller is running under.

result Task<T>

The result, when this maker took the run.

Returns

bool

Type Parameters

T

Remarks

Return a completed task when no asynchronous work is needed. The synchronous and asynchronous methods may accept different result types.

TryColdStart<T>(DbCommand, ICacheGivingParser<T>, bool, out T)

Tries to run T before the returned columns are known. Return false when a parser must be created after the reader opens.

public bool TryColdStart<T>(DbCommand cmd, ICacheGivingParser<T> cache, bool disposeCommand, out T result)

Parameters

cmd DbCommand

The command to run, not yet run.

cache ICacheGivingParser<T>

Turns the reader's columns into the parser for T.

disposeCommand bool

Whether the command is this run's to dispose.

result T

The result, when this maker took the run.

Returns

bool

Type Parameters

T

Remarks

Use this for a deferred result that must open the reader while it is consumed. Return false for buffered results or when the columns must be known first.

TryColdStart<T>(IDbCommand, ICacheGivingParser<T>, bool, out T)

Tries to run T before the returned columns are known. Return false when a parser must be created after the reader opens.

public bool TryColdStart<T>(IDbCommand cmd, ICacheGivingParser<T> cache, bool disposeCommand, out T result)

Parameters

cmd IDbCommand

The command to run, not yet run.

cache ICacheGivingParser<T>

Turns the reader's columns into the parser for T.

disposeCommand bool

Whether the command is this run's to dispose.

result T

The result, when this maker took the run.

Returns

bool

Type Parameters

T

Remarks

Use this for a deferred result that must open the reader while it is consumed. Return false for buffered results or when the columns must be known first.