Composite by Vitaly Kamiansky, Vladimir Ilin

<PackageReference Include="Composite" Version="1.5.5" />


public class EnumerableExtensions

public static IEnumerable<TResult> AccumulateSelectMany<TSource, TResult>(IEnumerable<TSource> source, AccumulateTransformRule<TSource, TResult>[] rules)

Finds elements in the input sequence to accumulate them in arrays, applies the respective transform functions to populated arrays, and concatenates the results.

public static IEnumerable<T[]> AsBatched<T>(IEnumerable<T> source, int batchSize, Func<T, int> getElementSize)

Divides the input sequence into batches of as many elements as possible their total size not exceeding batchSize but not less than one element per batch.

public static IEnumerable<T[]> AsPaged<T>(IEnumerable<T> source, int pageSize)

Splits the source enumerable into pages of size at most pageSize.

public static IEnumerable<T>[] AsPartitioned<T>(IEnumerable<T> source, int numberPartitions)

Splits the source enumerable into numberPartitions enumerables.