Class EnumerableHelper
public static class EnumerableHelper
- Inheritance
-
EnumerableHelper
Methods
Batch<T>(IEnumerable<T>, int)
Split enumerable source into batches of specified size. Limitation: each batch could be enumerated only once or exception will be generated.
public static IEnumerable<IEnumerable<T>> Batch<T>(IEnumerable<T> source, int batchSize)
Parameters
sourceIEnumerable<T>Source collection to split into batches.
batchSizeintSize of each batch. Must be positive number.
Returns
- IEnumerable<IEnumerable<T>>
New enumerable of batches.
Type Parameters
TType of element in source.