Click or drag to resize
Cimbalino ToolkitIEnumerableExtensionsBatchTResult Method
Produces a sequence containing batches of the current elements with the specified size.

Namespace: Cimbalino.Toolkit.Extensions
Assembly: Cimbalino.Toolkit.Core (in Cimbalino.Toolkit.Core.dll) Version: 2.2.1.0 (2.2.1.0)
Syntax
C#
public static IEnumerable<IEnumerable<TResult>> Batch<TResult>(
	this IEnumerable<TResult> source,
	int batchSize
)

Parameters

source
Type: System.Collections.GenericIEnumerableTResult
The enumerable.
batchSize
Type: SystemInt32
The batch size.

Type Parameters

TResult
The type of items in the enumerable.

Return Value

Type: IEnumerableIEnumerableTResult
A sequence containing batches of the current elements with the specified size.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTResult. 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).
Exceptions
ExceptionCondition
ArgumentExceptionIf the batch size is below 1.
Version Information

Portable

Supported in: 4.5

Windows

Supported in: 10.0, 8.1

Windows Phone

Supported in: 8.1

Windows Phone Silverlight

Supported in: 8.1, 8.0
See Also