ISqlStorageProvider<TReader> Interface
Extends ISqlStorageProvider with typed query methods that stream results through a user-supplied parser, and provides strongly-typed column-reading methods for common CLR types.
public interface ISqlStorageProvider<TReader> : HAKOM.Persistence.Sql.Net.Api.ISqlStorageProvider, HAKOM.Persistence.Core.Net.Api.Storage.IStorageProvider where TReader : System.Data.IDataReaderType parameters
Section titled “Type parameters”TReader
The provider-specific System.Data.IDataReader implementation.
Derived
↳ ISqlStorageProvider<TParameter,TParameterFactory,TReader>
↳ SqlStorageProvider<TConnection,TCommand,TNativeParameter,TReader,TParameter,TParameterFactory>
Implements ISqlStorageProvider, IStorageProvider
Remarks
Section titled “Remarks”Query methods come in pairs: a Try* variant returning
Result<TValue> and a throwing convenience
wrapper. Select methods return System.Collections.Generic.IAsyncEnumerable<> for
streaming, while SelectFirst methods return a single result.
The Read* methods (e.g. ReadBool, ReadInt,
ReadString) read a single column from the current row of a data reader,
optionally validating the column type and handling NULL values via a
fallback nullValue parameter.
Methods
Section titled “Methods”ISqlStorageProvider<TReader>.ReadBool(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadBool(TReader, int, bool) Method”Reads a System.Boolean value from the specified column of the current row.
bool ReadBool(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Boolean
The System.Boolean value of the column.
ISqlStorageProvider<TReader>.ReadBool(TReader, int, bool, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadBool(TReader, int, bool, bool) Method”Reads a System.Boolean value from the specified column, returning nullValue when the column is NULL.
bool ReadBool(TReader reader, int columnIndex, bool nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Boolean
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Boolean
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadBool(TReader, int, Nullable<bool>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadBool(TReader, int, Nullable<bool>, bool) Method”Reads a nullable System.Boolean value from the specified column, returning nullValue when the column is NULL.
System.Nullable<bool> ReadBool(TReader reader, int columnIndex, System.Nullable<bool> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.Boolean>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.Boolean>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadByte(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadByte(TReader, int, bool) Method”Reads a System.Byte value from the specified column of the current row.
byte ReadByte(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Byte
The System.Byte value of the column.
ISqlStorageProvider<TReader>.ReadByte(TReader, int, byte, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadByte(TReader, int, byte, bool) Method”Reads a System.Byte value from the specified column, returning nullValue when the column is NULL.
byte ReadByte(TReader reader, int columnIndex, byte nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Byte
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Byte
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadByte(TReader, int, Nullable<byte>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadByte(TReader, int, Nullable<byte>, bool) Method”Reads a nullable System.Byte value from the specified column, returning nullValue when the column is NULL.
System.Nullable<byte> ReadByte(TReader reader, int columnIndex, System.Nullable<byte> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.Byte>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.Byte>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadDateTime(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadDateTime(TReader, int, bool) Method”Reads a System.DateTime value from the specified column of the current row.
System.DateTime ReadDateTime(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.DateTime
The System.DateTime value of the column.
ISqlStorageProvider<TReader>.ReadDateTime(TReader, int, DateTime, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadDateTime(TReader, int, DateTime, bool) Method”Reads a System.DateTime value from the specified column, returning nullValue when the column is NULL.
System.DateTime ReadDateTime(TReader reader, int columnIndex, System.DateTime nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.DateTime
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.DateTime
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadDateTime(TReader, int, Nullable<DateTime>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadDateTime(TReader, int, Nullable<DateTime>, bool) Method”Reads a nullable System.DateTime value from the specified column, returning nullValue when the column is NULL.
System.Nullable<System.DateTime> ReadDateTime(TReader reader, int columnIndex, System.Nullable<System.DateTime> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.DateTime>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.DateTime>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadDecimal(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadDecimal(TReader, int, bool) Method”Reads a System.Decimal value from the specified column of the current row.
decimal ReadDecimal(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Decimal
The System.Decimal value of the column.
ISqlStorageProvider<TReader>.ReadDecimal(TReader, int, decimal, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadDecimal(TReader, int, decimal, bool) Method”Reads a System.Decimal value from the specified column, returning nullValue when the column is NULL.
decimal ReadDecimal(TReader reader, int columnIndex, decimal nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Decimal
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Decimal
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadDecimal(TReader, int, Nullable<decimal>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadDecimal(TReader, int, Nullable<decimal>, bool) Method”Reads a nullable System.Decimal value from the specified column, returning nullValue when the column is NULL.
System.Nullable<decimal> ReadDecimal(TReader reader, int columnIndex, System.Nullable<decimal> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.Decimal>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.Decimal>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadInt(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadInt(TReader, int, bool) Method”Reads an System.Int32 value from the specified column of the current row.
int ReadInt(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Int32
The System.Int32 value of the column.
ISqlStorageProvider<TReader>.ReadInt(TReader, int, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadInt(TReader, int, int, bool) Method”Reads an System.Int32 value from the specified column, returning nullValue when the column is NULL.
int ReadInt(TReader reader, int columnIndex, int nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Int32
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Int32
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadInt(TReader, int, Nullable<int>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadInt(TReader, int, Nullable<int>, bool) Method”Reads a nullable System.Int32 value from the specified column, returning nullValue when the column is NULL.
System.Nullable<int> ReadInt(TReader reader, int columnIndex, System.Nullable<int> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.Int32>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.Int32>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadLong(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadLong(TReader, int, bool) Method”Reads a System.Int64 value from the specified column of the current row.
long ReadLong(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Int64
The System.Int64 value of the column.
ISqlStorageProvider<TReader>.ReadLong(TReader, int, long, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadLong(TReader, int, long, bool) Method”Reads a System.Int64 value from the specified column, returning nullValue when the column is NULL.
long ReadLong(TReader reader, int columnIndex, long nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Int64
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Int64
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadLong(TReader, int, Nullable<long>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadLong(TReader, int, Nullable<long>, bool) Method”Reads a nullable System.Int64 value from the specified column, returning nullValue when the column is NULL.
System.Nullable<long> ReadLong(TReader reader, int columnIndex, System.Nullable<long> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.Int64>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.Int64>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadShort(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadShort(TReader, int, bool) Method”Reads a System.Int16 value from the specified column of the current row.
short ReadShort(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Int16
The System.Int16 value of the column.
ISqlStorageProvider<TReader>.ReadShort(TReader, int, short, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadShort(TReader, int, short, bool) Method”Reads a System.Int16 value from the specified column, returning nullValue when the column is NULL.
short ReadShort(TReader reader, int columnIndex, short nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Int16
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Int16
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadShort(TReader, int, Nullable<short>, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadShort(TReader, int, Nullable<short>, bool) Method”Reads a nullable System.Int16 value from the specified column, returning nullValue when the column is NULL.
System.Nullable<short> ReadShort(TReader reader, int columnIndex, System.Nullable<short> nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.Nullable<System.Int16>
The value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.Nullable<System.Int16>
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadString(TReader, int, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadString(TReader, int, bool) Method”Reads a System.String value from the specified column of the current row.
string ReadString(TReader reader, int columnIndex, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.String
The System.String value of the column.
ISqlStorageProvider<TReader>.ReadString(TReader, int, string, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadString(TReader, int, string, bool) Method”Reads a System.String value from the specified column, returning nullValue when the column is NULL.
string ReadString(TReader reader, int columnIndex, string nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.String
The non-null value to return when the column is NULL.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.String
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.ReadStringAllowingNull(TReader, int, string, bool) Method
Section titled “ISqlStorageProvider<TReader>.ReadStringAllowingNull(TReader, int, string, bool) Method”Reads a nullable System.String value from the specified column, returning nullValue when the column is NULL.
string? ReadStringAllowingNull(TReader reader, int columnIndex, string? nullValue, bool validateColumnType=true);Parameters
Section titled “Parameters”reader TReader
The data reader positioned on the current row.
columnIndex System.Int32
The zero-based column ordinal.
nullValue System.String
The value to return when the column is NULL, which may itself be null.
validateColumnType System.Boolean
If true, validates the column data type before reading.
Returns
Section titled “Returns”System.String
The column value, or nullValue if the column is NULL.
ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,Task<TResult>>, bool, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,Task<TResult>>, bool, CancellationToken) Method”Executes a parameter-less SQL query and streams all results parsed by an asynchronous parser delegate, with control over error handling.
System.Collections.Generic.IAsyncEnumerable<TResult> Select<TResult>(string sql, System.Func<TReader,System.Threading.Tasks.Task<TResult>> parser, bool abortOnParseError, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,System.Threading.Tasks.Task<TResult>>
An asynchronous delegate that converts a TReader row into TResult.
abortOnParseError System.Boolean
If true, stops enumeration when a parse error occurs; otherwise, skips failed rows.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<TResult>
An asynchronous sequence of parsed results.
ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method”Executes a parameter-less SQL query and streams all results parsed by an asynchronous parser delegate.
System.Collections.Generic.IAsyncEnumerable<TResult> Select<TResult>(string sql, System.Func<TReader,System.Threading.Tasks.Task<TResult>> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,System.Threading.Tasks.Task<TResult>>
An asynchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<TResult>
An asynchronous sequence of parsed results.
ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,TResult>, bool, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,TResult>, bool, CancellationToken) Method”Executes a parameter-less SQL query and streams all results parsed by a synchronous parser delegate, with control over error handling.
System.Collections.Generic.IAsyncEnumerable<TResult> Select<TResult>(string sql, System.Func<TReader,TResult> parser, bool abortOnParseError, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,TResult>
A synchronous delegate that converts a TReader row into TResult.
abortOnParseError System.Boolean
If true, stops enumeration when a parse error occurs; otherwise, skips failed rows.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<TResult>
An asynchronous sequence of parsed results.
ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,TResult>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.Select<TResult>(string, Func<TReader,TResult>, CancellationToken) Method”Executes a parameter-less SQL query and streams all results parsed by a synchronous parser delegate.
System.Collections.Generic.IAsyncEnumerable<TResult> Select<TResult>(string sql, System.Func<TReader,TResult> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,TResult>
A synchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<TResult>
An asynchronous sequence of parsed results.
ISqlStorageProvider<TReader>.SelectFirst<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.SelectFirst<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method”Executes a parameter-less SQL query and returns the first result parsed by an asynchronous parser delegate.
System.Threading.Tasks.Task<TResult> SelectFirst<TResult>(string sql, System.Func<TReader,System.Threading.Tasks.Task<TResult>> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,System.Threading.Tasks.Task<TResult>>
An asynchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<TResult>
The first parsed result.
ISqlStorageProvider<TReader>.SelectFirst<TResult>(string, Func<TReader,TResult>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.SelectFirst<TResult>(string, Func<TReader,TResult>, CancellationToken) Method”Executes a parameter-less SQL query and returns the first result parsed by a synchronous parser delegate.
System.Threading.Tasks.Task<TResult> SelectFirst<TResult>(string sql, System.Func<TReader,TResult> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,TResult>
A synchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<TResult>
The first parsed result.
ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,Task<TResult>>, bool, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,Task<TResult>>, bool, CancellationToken) Method”Attempts to execute a parameter-less SQL query and streams all results parsed by an asynchronous parser delegate, with control over error handling.
System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>> TrySelect<TResult>(string sql, System.Func<TReader,System.Threading.Tasks.Task<TResult>> parser, bool abortOnParseError, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,System.Threading.Tasks.Task<TResult>>
An asynchronous delegate that converts a TReader row into TResult.
abortOnParseError System.Boolean
If true, stops enumeration when a parse error occurs; otherwise, skips failed rows.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>>
An asynchronous sequence of Result<TValue> containing parsed results or errors.
ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method”Attempts to execute a parameter-less SQL query and streams all results parsed by an asynchronous parser delegate.
System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>> TrySelect<TResult>(string sql, System.Func<TReader,System.Threading.Tasks.Task<TResult>> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,System.Threading.Tasks.Task<TResult>>
An asynchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>>
An asynchronous sequence of Result<TValue> containing parsed results or errors.
ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,TResult>, bool, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,TResult>, bool, CancellationToken) Method”Attempts to execute a parameter-less SQL query and streams all results parsed by a synchronous parser delegate, with control over error handling.
System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>> TrySelect<TResult>(string sql, System.Func<TReader,TResult> parser, bool abortOnParseError, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,TResult>
A synchronous delegate that converts a TReader row into TResult.
abortOnParseError System.Boolean
If true, stops enumeration when a parse error occurs; otherwise, skips failed rows.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>>
An asynchronous sequence of Result<TValue> containing parsed results or errors.
ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,TResult>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.TrySelect<TResult>(string, Func<TReader,TResult>, CancellationToken) Method”Attempts to execute a parameter-less SQL query and streams all results parsed by a synchronous parser delegate.
System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>> TrySelect<TResult>(string sql, System.Func<TReader,TResult> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,TResult>
A synchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>>
An asynchronous sequence of Result<TValue> containing parsed results or errors.
ISqlStorageProvider<TReader>.TrySelectFirst<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.TrySelectFirst<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) Method”Attempts to execute a parameter-less SQL query and return the first result parsed by an asynchronous parser delegate.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>> TrySelectFirst<TResult>(string sql, System.Func<TReader,System.Threading.Tasks.Task<TResult>> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,System.Threading.Tasks.Task<TResult>>
An asynchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>>
A Result<TValue> containing the first parsed result, or an error.
ISqlStorageProvider<TReader>.TrySelectFirst<TResult>(string, Func<TReader,TResult>, CancellationToken) Method
Section titled “ISqlStorageProvider<TReader>.TrySelectFirst<TResult>(string, Func<TReader,TResult>, CancellationToken) Method”Attempts to execute a parameter-less SQL query and return the first result parsed by a synchronous parser delegate.
System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>> TrySelectFirst<TResult>(string sql, System.Func<TReader,TResult> parser, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Type parameters
Section titled “Type parameters”TResult
The type of the parsed result.
Parameters
Section titled “Parameters”sql System.String
The SQL query to execute.
parser System.Func<TReader,TResult>
A synchronous delegate that converts a TReader row into TResult.
cancellationToken System.Threading.CancellationToken
A token to cancel the operation.
Returns
Section titled “Returns”System.Threading.Tasks.Task<HAKOM.ErrorHandling.Core.Net.Api.Result<TResult>>
A Result<TValue> containing the first parsed result, or an error.