Method RetrieveAsync
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
RetrieveAsync(DbDataReader, bool, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, bool useReadAsync = true, CancellationToken cancellationToken = default)
Parameters
readerDbDataReaderThe DbDataReader to read results from.
useReadAsyncboolIf true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, CancellationToken cancellationToken)
Parameters
readerDbDataReaderThe DbDataReader to read results from.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, IEnumerable<int>, bool, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, IEnumerable<int> ordinals, bool useReadAsync = true, CancellationToken cancellationToken = default)
Parameters
readerDbDataReaderThe reader to enumerate.
ordinalsIEnumerable<int>The limited set of ordinals to include. If none are specified, the returned objects will be empty.
useReadAsyncboolIf true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, IEnumerable<int>, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, IEnumerable<int> ordinals, CancellationToken cancellationToken)
Parameters
readerDbDataReaderThe reader to enumerate.
ordinalsIEnumerable<int>The limited set of ordinals to include. If none are specified, the returned objects will be empty.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, int, params IEnumerable<int>)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, int n, params IEnumerable<int> others)
Parameters
readerDbDataReaderThe reader to enumerate.
nintThe first ordinal to include in the request to the reader for each record.
othersIEnumerable<int>The remaining ordinals to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, CancellationToken, int, params IEnumerable<int>)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, CancellationToken cancellationToken, int n, params IEnumerable<int> others)
Parameters
readerDbDataReaderThe reader to enumerate.
cancellationTokenCancellationTokenA cancellation token.
nintThe first ordinal to include in the request to the reader for each record.
othersIEnumerable<int>The remaining ordinals to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, IEnumerable<string>, bool, bool, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, IEnumerable<string> columnNames, bool normalizeColumnOrder = false, bool useReadAsync = true, CancellationToken cancellationToken = default)
Parameters
readerDbDataReaderThe DbDataReader to read results from.
columnNamesIEnumerable<string>The column names to select.
normalizeColumnOrderboolOrders the results arrays by ordinal.
useReadAsyncboolIf true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, IEnumerable<string>, bool, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, IEnumerable<string> columnNames, bool normalizeColumnOrder, CancellationToken cancellationToken)
Parameters
readerDbDataReaderThe DbDataReader to read results from.
columnNamesIEnumerable<string>The column names to select.
normalizeColumnOrderboolOrders the results arrays by ordinal.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, IEnumerable<string>, CancellationToken)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, IEnumerable<string> columnNames, CancellationToken cancellationToken)
Parameters
readerDbDataReaderThe DbDataReader to read results from.
columnNamesIEnumerable<string>The column names to select.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, string, params IEnumerable<string>)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, string c, params IEnumerable<string> others)
Parameters
readerDbDataReaderThe IDataReader to read results from.
cstringThe first column name to include in the request to the reader for each record.
othersIEnumerable<string>The remaining column names to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbDataReader, CancellationToken, string, params IEnumerable<string>)
Asynchronously enumerates all records within the current result set using an DbDataReader and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbDataReader reader, CancellationToken cancellationToken, string c, params IEnumerable<string> others)
Parameters
readerDbDataReaderThe IDataReader to read results from.
cancellationTokenCancellationTokenThe cancellation token.
cstringThe first column name to include in the request to the reader for each record.
othersIEnumerable<string>The remaining column names to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
RetrieveAsync(DbCommand, bool, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, bool useReadAsync = true, CancellationToken cancellationToken = default)
Parameters
commandDbCommandThe command to generate a reader from.
useReadAsyncboolIf true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, CancellationToken cancellationToken)
Parameters
commandDbCommandThe command to generate a reader from.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, IEnumerable<int>, bool, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, IEnumerable<int> ordinals, bool useReadAsync = true, CancellationToken cancellationToken = default)
Parameters
commandDbCommandThe command to generate a reader from.
ordinalsIEnumerable<int>The limited set of ordinals to include. If none are specified, the returned objects will be empty.
useReadAsyncboolIf true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, IEnumerable<int>, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, IEnumerable<int> ordinals, CancellationToken cancellationToken)
Parameters
commandDbCommandThe command to generate a reader from.
ordinalsIEnumerable<int>The limited set of ordinals to include. If none are specified, the returned objects will be empty.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, int, params IEnumerable<int>)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, int n, params IEnumerable<int> others)
Parameters
commandDbCommandThe DbCommand to generate a reader from.
nintThe first ordinal to include in the request to the reader for each record.
othersIEnumerable<int>The remaining ordinals to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, CancellationToken, int, params IEnumerable<int>)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, CancellationToken cancellationToken, int n, params IEnumerable<int> others)
Parameters
commandDbCommandThe command to generate a reader from.
cancellationTokenCancellationTokenThe cancellation token.
nintThe first ordinal to include in the request to the reader for each record.
othersIEnumerable<int>The remaining ordinals to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, IEnumerable<string>, bool, bool, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, IEnumerable<string> columnNames, bool normalizeColumnOrder = false, bool useReadAsync = true, CancellationToken cancellationToken = default)
Parameters
commandDbCommandThe DbCommand to generate a reader from.
columnNamesIEnumerable<string>The column names to select.
normalizeColumnOrderboolOrders the results arrays by ordinal.
useReadAsyncboolIf true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, IEnumerable<string>, bool, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, IEnumerable<string> columnNames, bool normalizeColumnOrder, CancellationToken cancellationToken)
Parameters
commandDbCommandThe DbCommand to generate a reader from.
columnNamesIEnumerable<string>The column names to select.
normalizeColumnOrderboolOrders the results arrays by ordinal.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, IEnumerable<string>, CancellationToken)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, IEnumerable<string> columnNames, CancellationToken cancellationToken)
Parameters
commandDbCommandThe DbCommand to generate a reader from.
columnNamesIEnumerable<string>The column names to select.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, string, params IEnumerable<string>)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, string columnName, params IEnumerable<string> otherColumnNames)
Parameters
commandDbCommandThe DbCommand to generate a reader from.
columnNamestringThe first column name to include in the request to the reader for each record.
otherColumnNamesIEnumerable<string>The remaining column names to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.
RetrieveAsync(DbCommand, CancellationToken, string, params IEnumerable<string>)
Asynchronously executes a reader and enumerates all the remaining values of the current result set and returns the desired results.
public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(this DbCommand command, CancellationToken cancellationToken, string columnName, params IEnumerable<string> otherColumnNames)
Parameters
commandDbCommandThe DbCommand to generate a reader from.
cancellationTokenCancellationTokenThe cancellation token.
columnNamestringThe first column name to include in the request to the reader for each record.
otherColumnNamesIEnumerable<string>The remaining column names to request from the reader for each record.
Returns
- ValueTask<QueryResultQueue<object[]>>
The query result that contains all the results and the column mappings.
Remarks
DBNull values are left unchanged (retained).
The default behavior will open a connection, execute the reader and close the connection it if was not already open.