AsyncEnumerable.Chunk<TSource> Método

Definición

Divida los elementos de una secuencia en fragmentos de tamaño como 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

Tipo de los elementos de origen.

Parámetros

source
IAsyncEnumerable<TSource>

cuyos IAsyncEnumerable<T> elementos se van a fragmentar.

size
Int32

Tamaño máximo de cada fragmento.

Devoluciones

IAsyncEnumerable<TSource[]>

que IAsyncEnumerable<T> contiene los elementos de la secuencia de entrada divididos en fragmentos de tamaño size.

Excepciones

source es null.

size es menor que 1.

Comentarios

Cada fragmento excepto el último será de tamaño size. El último fragmento contendrá los elementos restantes y puede tener un tamaño menor.

Se aplica a