AsyncEnumerable.Chunk<TSource> メソッド

定義

シーケンスの要素を最大 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())

型パラメーター

TSource

ソースの要素の型。

パラメーター

source
IAsyncEnumerable<TSource>

チャンクする要素を持つ IAsyncEnumerable<T>

size
Int32

各チャンクの最大サイズ。

返品

IAsyncEnumerable<TSource[]>

サイズsizeのチャンクに分割された入力シーケンスの要素を含むIAsyncEnumerable<T>

例外

sourcenullです。

size が 1 未満です。

注釈

最後を除くすべてのチャンクは、サイズ sizeになります。 最後のチャンクには残りの要素が含まれており、サイズが小さい場合があります。

適用対象