AsyncEnumerable.Chunk<TSource> Método

Definição

Divida os elementos de uma sequência em blocos 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 Genérico

TSource

O tipo dos elementos da fonte.

Parâmetros

source
IAsyncEnumerable<TSource>

E IAsyncEnumerable<T> de quem os elementos devem ser cortados.

size
Int32

Tamanho máximo de cada bloco.

Devoluções

IAsyncEnumerable<TSource[]>

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

Exceções

source é null.

size é inferior a 1.

Observações

Todos os pedaços, exceto o último, serão de tamanho size. O último bloco conterá os elementos restantes e poderá ser de tamanho menor.

Aplica-se a