BaseExtensionsBatchT Method |
Returns input in batches of batchSize size.
Namespace: CMS.BaseAssembly: CMS.Base (in CMS.Base.dll) Version: 13.0.131
Syntax 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:
IEnumerableIEnumerableTUsage 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