DbRawSqlQuery<TElement>.ToListAsync Method

Definition

Overloads

ToListAsync()

Creates a List<T> from the query by enumerating it asynchronously.

ToListAsync(CancellationToken)

Creates a List<T> from the query by enumerating it asynchronously.

ToListAsync()

Creates a List<T> from the query by enumerating it asynchronously.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public System.Threading.Tasks.Task<System.Collections.Generic.List<TElement>> ToListAsync ();
member this.ToListAsync : unit -> System.Threading.Tasks.Task<System.Collections.Generic.List<'Element>>
Public Function ToListAsync () As Task(Of List(Of TElement))

Returns

Task<List<TElement>>

A task that represents the asynchronous operation. The task result contains a List<T> that contains elements from the input sequence.

Attributes

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to

ToListAsync(CancellationToken)

Creates a List<T> from the query by enumerating it asynchronously.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public System.Threading.Tasks.Task<System.Collections.Generic.List<TElement>> ToListAsync (System.Threading.CancellationToken cancellationToken);
member this.ToListAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.List<'Element>>

Parameters

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Returns

Task<List<TElement>>

A task that represents the asynchronous operation. The task result contains a List<T> that contains elements from the input sequence.

Attributes

Remarks

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Applies to