Click or drag to resize
BaseExtensionsBatchT Method
Returns input in batches of batchSize size.

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 13.0.131
Syntax
C#
public static IEnumerable<IEnumerable<T>> Batch<T>(
	this IEnumerable<T> collection,
	int batchSize
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
Collection to be batched
batchSize
Type: SystemInt32
Size of each chunk (except for the last one)

Type Parameters

T

Return Value

Type: IEnumerableIEnumerableT

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also