IEnumerableExtensions.Batch<TSource> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
IEnumerable<IEnumerable<TSource>>