Show / Hide Table of Contents

Class BatchUtility

Utility class for working with batches of items.

Inheritance
object
BatchUtility
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.CosmosDb.Utilities
Assembly: Benday.CosmosDb.dll
Syntax
public static class BatchUtility

Methods

| Edit this page View Source

CreateArrayForBatch<T>(List<T>, int, int)

Creates an array of items for a specific batch number.

Declaration
public static T[] CreateArrayForBatch<T>(List<T> results, int batchSize, int batchNumber)
Parameters
Type Name Description
List<T> results
int batchSize
int batchNumber
Returns
Type Description
T[]
Type Parameters
Name Description
T
Exceptions
Type Condition
ArgumentOutOfRangeException
| Edit this page View Source

GetBatchCount(int, int)

Gets the number of batches that will be created.

Declaration
public static int GetBatchCount(int itemCount, int batchSize)
Parameters
Type Name Description
int itemCount
int batchSize
Returns
Type Description
int
| Edit this page View Source

GetBatches<T>(IEnumerable<T>, int)

Gets a list of arrays of items that are batched.

Declaration
public static List<T[]> GetBatches<T>(IEnumerable<T> values, int batchSize)
Parameters
Type Name Description
IEnumerable<T> values

Values to convert to batches

int batchSize

Number of items per batch

Returns
Type Description
List<T[]>
Type Parameters
Name Description
T
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com