AsyncEnumerable<TResult>.ToListAsync(CancellationToken) 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.
Asynchronously creates a List<T> from this AsyncEnumerable<TResult> by enumerating it asynchronously.
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> ToListAsync (System.Threading.CancellationToken cancellationToken = default);
member this.ToListAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.List<'Result>>
Public Function ToListAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of List(Of TResult))
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 input sequence.
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
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor