CollectionUtilities..::..BatchAsLists<(Of <(<'T>)>)> Method

Batches the specified enumeration into lists according to the indicated batch size.

Namespace:  Tortuga.Anchor
Assembly:  Tortuga.Anchor (in Tortuga.Anchor.dll)

Syntax


public static IEnumerable<List<T>> BatchAsLists<T>(
	IEnumerable<T> source,
	int batchSize
)
Public Shared Function BatchAsLists(Of T) ( _
	source As IEnumerable(Of T), _
	batchSize As Integer _
) As IEnumerable(Of List(Of T))

Type Parameters

T

Parameters

source
Type: IEnumerable<(Of <(<'T>)>)>
The source.
batchSize
Type: Int32
Size of the batch.

Return Value

IEnumerable<List<T>>.

Exceptions


ExceptionCondition
[ArgumentNullException]source
[ArgumentOutOfRangeException]batchSize