Interface ITypeParser
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
Remarks
Often SequentialAccess or SingleResult.
Type
Gets the result type produced by this parser.
Type Type { get; }
Property Value
Methods
CanParse(ColumnInfo[])
Whether this parser can read a result carrying schema.
bool CanParse(ColumnInfo[] schema)
Parameters
schemaColumnInfo[]
Returns
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
ParseObject(DbDataReader)
Parses the current reader row.
(bool CanContinue, object? Result) ParseObject(DbDataReader reader)
Parameters
readerDbDataReader
Returns
ParseObjectAsync(DbDataReader, CancellationToken)
Parses the current reader row asynchronously.
ValueTask<(bool CanContinue, object? Result)> ParseObjectAsync(DbDataReader reader, CancellationToken ct = default)
Parameters
readerDbDataReaderctCancellationToken
Returns
QueryObject(DbCommand, ICache?, bool)
Executes a command and parses its result.
object? QueryObject(DbCommand command, ICache? cache = null, bool disposeCommand = false)
Parameters
Returns
QueryObject(IDbCommand, ICache?, bool)
Executes a command and parses its result.
object? QueryObject(IDbCommand command, ICache? cache = null, bool disposeCommand = false)
Parameters
commandIDbCommandcacheICachedisposeCommandbool
Returns
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
commandDbCommandcacheICachedisposeCommandboolctCancellationToken
Returns
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
commandIDbCommandcacheICachedisposeCommandboolctCancellationToken