DbRawSqlQuery.ToListAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 virtual System.Threading.Tasks.Task<System.Collections.Generic.List<object>> ToListAsync ();
abstract member ToListAsync : unit -> System.Threading.Tasks.Task<System.Collections.Generic.List<obj>>
override this.ToListAsync : unit -> System.Threading.Tasks.Task<System.Collections.Generic.List<obj>>
Public Overridable Function ToListAsync () As Task(Of List(Of Object))
Returns
A task that represents the asynchronous operation. The task result contains a List<T> that contains elements from the query.
- 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 virtual System.Threading.Tasks.Task<System.Collections.Generic.List<object>> ToListAsync (System.Threading.CancellationToken cancellationToken);
abstract member ToListAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.List<obj>>
override this.ToListAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.List<obj>>
Parameters
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
A task that represents the asynchronous operation. The task result contains a List<T> that contains elements from the query.
- 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
Entity Framework