Method SearchAsync
- Namespace
- YndigoBlue.Velocity.Engine
- Assembly
- YndigoBlue.Velocity.dll
SearchAsync(Query, CancellationToken)
Asynchronous counterpart to Search(Query). Executes a query and returns a forward-only,
streaming ResultReader opened with ExecuteReaderAsync.
public Task<ResultReader> SearchAsync(Query query, CancellationToken cancellationToken = default)
Parameters
queryQueryThe Query to execute.
cancellationTokenCancellationTokenToken used to cancel the operation.
Returns
- Task<ResultReader>
A ResultReader that can be iterated with
await foreach.
Remarks
Wrap the returned reader in await using and consume it (via await foreach,
BindResultsAsync<T>(BindingType, CancellationToken) or
BindColumnAsync<T>(string, CancellationToken)) before disposal.
await using var reader = await m.SearchAsync(query, ct);
await foreach (var row in reader.WithCancellation(ct))
{
// ...
}