Share via


QueryableExtensions.ToArrayAsync Method

Definition

Overloads

ToArrayAsync<TSource>(IQueryable<TSource>, CancellationToken)

Creates an array from an IQueryable<T> by enumerating it asynchronously.

ToArrayAsync<TSource>(IQueryable<TSource>)

Creates an array from an IQueryable<T> by enumerating it asynchronously.

ToArrayAsync<TSource>(IQueryable<TSource>, CancellationToken)

Creates an array from an IQueryable<T> by enumerating it asynchronously.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<TSource[]> ToArrayAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Threading.CancellationToken cancellationToken);
static member ToArrayAsync : System.Linq.IQueryable<'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Source[]>

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IQueryable<TSource>

An IQueryable<T> to create an array from.

cancellationToken
CancellationToken

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

Returns

Task<TSource[]>

A task that represents the asynchronous operation. The task result contains an array 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

ToArrayAsync<TSource>(IQueryable<TSource>)

Creates an array from an IQueryable<T> by enumerating it asynchronously.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<TSource[]> ToArrayAsync<TSource> (this System.Linq.IQueryable<TSource> source);
static member ToArrayAsync : System.Linq.IQueryable<'Source> -> System.Threading.Tasks.Task<'Source[]>
<Extension()>
Public Function ToArrayAsync(Of TSource) (source As IQueryable(Of TSource)) As Task(Of TSource())

Type Parameters

TSource

The type of the elements of source.

Parameters

source
IQueryable<TSource>

An IQueryable<T> to create an array from.

Returns

Task<TSource[]>

A task that represents the asynchronous operation. The task result contains an array 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