AsyncEnumerable.Chunk<TSource> Método

Definição

Divida os elementos de uma sequência em partes de tamanho no máximo size.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IAsyncEnumerable<cli::array <TSource> ^> ^ Chunk(System::Collections::Generic::IAsyncEnumerable<TSource> ^ source, int size);
public static System.Collections.Generic.IAsyncEnumerable<TSource[]> Chunk<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, int size);
static member Chunk : System.Collections.Generic.IAsyncEnumerable<'Source> * int -> System.Collections.Generic.IAsyncEnumerable<'Source[]>
<Extension()>
Public Function Chunk(Of TSource) (source As IAsyncEnumerable(Of TSource), size As Integer) As IAsyncEnumerable(Of TSource())

Parâmetros de tipo

TSource

O tipo dos elementos de origem.

Parâmetros

source
IAsyncEnumerable<TSource>

Um IAsyncEnumerable<T> cujos elementos serão agrupados.

size
Int32

Tamanho máximo de cada parte.

Retornos

IAsyncEnumerable<TSource[]>

Um IAsyncEnumerable<T> que contém os elementos da sequência de entrada divididos em partes de tamanho size.

Exceções

source é null.

size é menor que 1.

Comentários

Cada parte, exceto a última, será de tamanho size. A última parte conterá os elementos restantes e poderá ter um tamanho menor.

Aplica-se a