Table of Contents

Interface ITypeParser

Namespace
Rinku.Mapping.Parsers
Assembly
Rinku.dll

Describes a parser that reads query rows. Use ITypeParser<T> for a typed result.

public interface ITypeParser : IDisposable
Inherited Members
Extension Methods

Properties

Behavior

The reader behavior this parser wants, passed to ExecuteReader(CommandBehavior).

CommandBehavior Behavior { get; }

Property Value

CommandBehavior

Remarks

Type

Gets the result type produced by this parser.

Type Type { get; }

Property Value

Type

Methods

CanParse(ColumnInfo[])

Whether this parser can read a result carrying schema.

bool CanParse(ColumnInfo[] schema)

Parameters

schema ColumnInfo[]

Returns

bool

Remarks

A parser may accept several schemas. A parser that reads names and types at each call may accept every schema.

DefaultObject()

Creates the result returned when no row is available.

object? DefaultObject()

Returns

object

ParseObject(DbDataReader)

Parses the current reader row.

(bool CanContinue, object? Result) ParseObject(DbDataReader reader)

Parameters

reader DbDataReader

Returns

(bool CanContinue, object Result)

ParseObjectAsync(DbDataReader, CancellationToken)

Parses the current reader row asynchronously.

ValueTask<(bool CanContinue, object? Result)> ParseObjectAsync(DbDataReader reader, CancellationToken ct = default)

Parameters

reader DbDataReader
ct CancellationToken

Returns

ValueTask<(bool CanContinue, object Result)>

QueryObject(DbCommand, ICache?, bool)

Executes a command and parses its result.

object? QueryObject(DbCommand command, ICache? cache = null, bool disposeCommand = false)

Parameters

command DbCommand
cache ICache
disposeCommand bool

Returns

object

QueryObject(IDbCommand, ICache?, bool)

Executes a command and parses its result.

object? QueryObject(IDbCommand command, ICache? cache = null, bool disposeCommand = false)

Parameters

command IDbCommand
cache ICache
disposeCommand bool

Returns

object

QueryObjectAsync(DbCommand, ICache?, bool, CancellationToken)

Executes a command and parses its result asynchronously.

Task<object?> QueryObjectAsync(DbCommand command, ICache? cache = null, bool disposeCommand = false, CancellationToken ct = default)

Parameters

command DbCommand
cache ICache
disposeCommand bool
ct CancellationToken

Returns

Task<object>

QueryObjectAsync(IDbCommand, ICache?, bool, CancellationToken)

Executes a command and parses its result asynchronously.

Task<object?> QueryObjectAsync(IDbCommand command, ICache? cache = null, bool disposeCommand = false, CancellationToken ct = default)

Parameters

command IDbCommand
cache ICache
disposeCommand bool
ct CancellationToken

Returns

Task<object>