Interface ITypeParser<T>
Reads query rows as T. Implement one to add a result shape that can be requested
through Query<T>.
public interface ITypeParser<T> : ITypeParser, IDisposable
Type Parameters
T
- Inherited Members
- Extension Methods
Methods
Default()
The value to return when the result has no row, an empty collection or optional, for instance.
T Default()
Returns
- T
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
(bool CanContinue, T Result) Parse(DbDataReader reader)
Parameters
readerDbDataReader
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
ValueTask<(bool CanContinue, T Result)> ParseAsync(DbDataReader reader, CancellationToken ct = default)
Parameters
readerDbDataReaderctCancellationToken
Returns
- ValueTask<(bool CanContinue, T Result)>
Query(DbCommand, ICache, bool)
Runs command and reads its result as T, also letting cache learn from the executed command.
T Query(DbCommand command, ICache cache, bool disposeCommand = false)
Parameters
Returns
- T
Query(DbCommand, bool)
Runs command and reads its result as T, disposing the command afterward when disposeCommand is set.
T Query(DbCommand command, bool disposeCommand = false)
Parameters
Returns
- T
Query(IDbCommand, ICache, bool)
Runs command and reads its result as T, also letting cache learn from the executed command.
T Query(IDbCommand command, ICache cache, bool disposeCommand = false)
Parameters
commandIDbCommandcacheICachedisposeCommandbool
Returns
- T
Query(IDbCommand, bool)
Runs command and reads its result as T, disposing the command afterward when disposeCommand is set.
T Query(IDbCommand command, bool disposeCommand = false)
Parameters
commandIDbCommanddisposeCommandbool
Returns
- T
QueryAsync(DbCommand, ICache, bool, CancellationToken)
Runs command and reads its result as T, also letting cache learn from the executed command.
Task<T> QueryAsync(DbCommand command, ICache cache, bool disposeCommand = false, CancellationToken ct = default)
Parameters
commandDbCommandcacheICachedisposeCommandboolctCancellationToken
Returns
- Task<T>
QueryAsync(DbCommand, bool, CancellationToken)
Runs command and reads its result as T, disposing the command afterward when disposeCommand is set.
Task<T> QueryAsync(DbCommand command, bool disposeCommand = false, CancellationToken ct = default)
Parameters
commandDbCommanddisposeCommandboolctCancellationToken
Returns
- Task<T>
QueryAsync(IDbCommand, ICache, bool, CancellationToken)
Runs command and reads its result as T, also letting cache learn from the executed command.
Task<T> QueryAsync(IDbCommand command, ICache cache, bool disposeCommand = false, CancellationToken ct = default)
Parameters
commandIDbCommandcacheICachedisposeCommandboolctCancellationToken
Returns
- Task<T>
QueryAsync(IDbCommand, bool, CancellationToken)
Runs command and reads its result as T, disposing the command afterward when disposeCommand is set.
Task<T> QueryAsync(IDbCommand command, bool disposeCommand = false, CancellationToken ct = default)
Parameters
commandIDbCommanddisposeCommandboolctCancellationToken
Returns
- Task<T>