你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IEnumerableExtensions.Batch<TSource> Method

Definition

Batches an enumerable into batches of the specified size.

public static System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<TSource>> Batch<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, int batchSize = 10);
static member Batch : seq<'Source> * int -> seq<seq<'Source>>
<Extension()>
Public Iterator Function Batch(Of TSource) (source As IEnumerable(Of TSource), Optional batchSize As Integer = 10) As IEnumerable(Of IEnumerable(Of TSource))

Type Parameters

TSource

The source type/

Parameters

source
IEnumerable<TSource>

The enumerable to batch.

batchSize
Int32

The batch size.

Returns

Applies to