Table of Contents

Class MultiRowTypeParser<T, TState>

Namespace
Rinku.Mapping.Parsers.Defaults
Assembly
Rinku.dll

Reads a multi row value through TState. Use this parser when a state object can add each row and build the final value.

public class MultiRowTypeParser<T, TState> : BaseTypeParser<T>, ITypeParser<T>, ITypeParser, IDisposable where TState : IMultiRowState<T>, new()

Type Parameters

T
TState
Inheritance
MultiRowTypeParser<T, TState>
Implements
Derived
Inherited Members
Extension Methods

Constructors

MultiRowTypeParser(ColumnInfo[])

Creates a parser for the supplied schema.

public MultiRowTypeParser(ColumnInfo[] schema)

Parameters

schema ColumnInfo[]

MultiRowTypeParser(ColumnInfo[], CommandBehavior)

Creates a parser for the supplied schema and reader behavior.

public MultiRowTypeParser(ColumnInfo[] schema, CommandBehavior behavior)

Parameters

schema ColumnInfo[]
behavior CommandBehavior

Properties

Behavior

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

public override CommandBehavior Behavior { get; }

Property Value

CommandBehavior

Remarks

Methods

CanParse(ColumnInfo[])

Whether this parser can read a result carrying schema.

public override 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.

Default()

The value to return when the result has no row, an empty collection or optional, for instance.

public override T Default()

Returns

T

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

Parse(DbDataReader)

Parses one T starting at the current row, advancing the reader as it goes. CanContinue reports the state of the reader on return, true when it is positioned on an untreated row, false when no row is left

public override (bool CanContinue, T Result) Parse(DbDataReader reader)

Parameters

reader DbDataReader

Returns

(bool CanContinue, T Result)

ParseAsync(DbDataReader, CancellationToken)

Parses one T starting at the current row, advancing the reader as it goes. CanContinue reports the state of the reader on return, true when it is positioned on an untreated row, false when no row is left

public override ValueTask<(bool CanContinue, T Result)> ParseAsync(DbDataReader reader, CancellationToken ct = default)

Parameters

reader DbDataReader
ct CancellationToken

Returns

ValueTask<(bool CanContinue, T Result)>