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