Table of Contents

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

query Query

The Query to execute.

cancellationToken CancellationToken

Token used to cancel the operation.

Returns

Task<ResultSet>

A ResultSet containing all query results.

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

query Query

The query to execute.

bindingType BindingType

Controls how column names are mapped to properties. Defaults to DirectMap.

cancellationToken CancellationToken

Token used to cancel the operation.

Returns

Task<IList<T>>

A fully materialised IList<T> of T.

Type Parameters

T

The 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.