Method RetrieveAsync
- Namespace
- YndigoBlue.Velocity.Engine
- Assembly
- YndigoBlue.Velocity.dll
RetrieveAsync(Query, CancellationToken)
Asynchronous counterpart to Retrieve(Query). Executes a query and returns all results in a
disconnected in-memory ResultSet, loaded via ExecuteReaderAsync.
public Task<ResultSet> RetrieveAsync(Query query, CancellationToken cancellationToken = default)
Parameters
queryQueryThe Query to execute.
cancellationTokenCancellationTokenToken used to cancel the operation.
Returns
Remarks
The returned ResultSet is in memory and disconnected; dispose it with a using block.
RetrieveAsync<T>(Query, BindingType, CancellationToken)
Asynchronous counterpart to Retrieve<T>(Query, BindingType). Executes the query, binds the
results to a list of T, and disposes the underlying ResultSet automatically.
public Task<IList<T>> RetrieveAsync<T>(Query query, BindingType bindingType = BindingType.DirectMap, CancellationToken cancellationToken = default) where T : new()
Parameters
queryQueryThe query to execute.
bindingTypeBindingTypeControls how column names are mapped to properties. Defaults to DirectMap.
cancellationTokenCancellationTokenToken used to cancel the operation.
Returns
Type Parameters
TThe type to bind each row to. Must have a parameterless constructor.
Remarks
The data is fetched asynchronously; binding happens in memory once all rows are loaded.