Table of Contents

Method ToListAsync

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

ToListAsync(CancellationToken)

Asynchronously reads every mapped row into a new List<T>.

public ValueTask<List<T>> ToListAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels the operation. When it cannot be canceled, the cancellation token set on the underlying command applies.

Returns

ValueTask<List<T>>

A task that produces a list of all the rows, in the order the database returned them.

Remarks

All rows are buffered in memory before the call returns. Use Read(Action<IEnumerable<T>>) to process very large results as a stream.

Exceptions

OperationCanceledException

The operation was canceled.

See Also