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
source
IAsyncEnumerable<T>Source collection to split into batches.
batchSize
intSize of each batch. Must be positive number.
Returns
- IAsyncEnumerable<IAsyncEnumerable<T>>
New enumerable of batches.
Type Parameters
T
Type 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
source
IEnumerable<T>Source collection to split into batches.
batchSize
intSize of each batch. Must be positive number.
Returns
- IEnumerable<IEnumerable<T>>
New enumerable of batches.
Type Parameters
T
Type of element in source.