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

Batches the specified enumeration into lightweight segments according to the indicated batch size.

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

Syntax


public static IEnumerable<ReadOnlyListSegment<T>> BatchAsSegments<T>(
	IReadOnlyList<T> source,
	int batchSize
)
Public Shared Function BatchAsSegments(Of T) ( _
	source As IReadOnlyList(Of T), _
	batchSize As Integer _
) As IEnumerable(Of ReadOnlyListSegment(Of T))

Type Parameters

T

Parameters

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

Return Value

IEnumerable<List<T>>.

Exceptions


ExceptionCondition
[ArgumentNullException]source
[ArgumentOutOfRangeException]batchSize