Sdílet prostřednictvím


TableBatchOperation Class

Definition

Represents a batch operation on a table.

public sealed class TableBatchOperation : System.Collections.Generic.ICollection<Microsoft.Azure.Cosmos.Table.TableOperation>, System.Collections.Generic.IEnumerable<Microsoft.Azure.Cosmos.Table.TableOperation>, System.Collections.Generic.IList<Microsoft.Azure.Cosmos.Table.TableOperation>
type TableBatchOperation = class
    interface IList<TableOperation>
    interface ICollection<TableOperation>
    interface seq<TableOperation>
    interface IEnumerable
Public NotInheritable Class TableBatchOperation
Implements ICollection(Of TableOperation), IEnumerable(Of TableOperation), IList(Of TableOperation)
Inheritance
TableBatchOperation
Implements

Remarks

A batch operation is a collection of table operations which are executed by the Storage Service REST API as a single atomic operation, by invoking an Entity Group Transaction.

A batch operation may contain up to 100 individual table operations, with the requirement that each operation entity must have same partition key. A batch with a retrieve operation cannot contain any other operations. Note that the total payload of a batch operation is limited to 4MB.

Constructors

TableBatchOperation()

Initializes a new instance of the TableBatchOperation class.

Properties

Count

Gets the number of operations in this TableBatchOperation.

IsReadOnly

Gets a value indicating whether the TableBatchOperation is read-only.

Item[Int32]

Gets or sets the TableOperation item at the specified index.

Methods

Add(TableOperation)

Adds the TableOperation to the TableBatchOperation.

Clear()

Clears all TableOperation objects from the TableBatchOperation.

Contains(TableOperation)

Returns true if this TableBatchOperation contains the specified element.

CopyTo(TableOperation[], Int32)

Copies all the elements of the TableBatchOperation to the specified one-dimensional array starting at the specified destination array index.

Delete(ITableEntity)

Adds a TableOperation to the TableBatchOperation that deletes the specified entity from a table.

GetEnumerator()

Returns an IEnumerator<T> for the TableBatchOperation.

IndexOf(TableOperation)

Returns the zero-based index of the first occurrence of the specified TableOperation item, or -1 if the TableBatchOperation does not contain the item.

Insert(Int32, TableOperation)

Inserts a TableOperation into the TableBatchOperation at the specified index.

Insert(ITableEntity, Boolean)

Adds a TableOperation object that inserts the specified entity into the table as part of the batch operation.

Insert(ITableEntity)

Adds a TableOperation to the TableBatchOperation that inserts the specified entity into a table.

InsertOrMerge(ITableEntity)

Adds a TableOperation to the TableBatchOperation that inserts the specified entity into a table if the entity does not exist; if the entity does exist then its contents are merged with the provided entity.

InsertOrReplace(ITableEntity)

Adds a TableOperation to the TableBatchOperation that inserts the specified entity into a table if the entity does not exist; if the entity does exist then its contents are replaced with the provided entity.

Merge(ITableEntity)

Adds a TableOperation to the TableBatchOperation that merges the contents of the specified entity with the existing entity in a table.

Remove(TableOperation)

Removes the specified TableOperation item from the TableBatchOperation.

RemoveAt(Int32)

Removes the TableOperation at the specified index from the TableBatchOperation.

Replace(ITableEntity)

Adds a TableOperation to the TableBatchOperation that replaces the contents of the specified entity in a table.

Retrieve(String, String)

Adds a TableOperation to the TableBatchOperation that retrieves an entity with the specified partition key and row key.

Retrieve<TElement>(String, String, List<String>)

Inserts a TableOperation into the batch that retrieves an entity based on its row key and partition key. The entity will be deserialized into the specified class type which extends ITableEntity.

Retrieve<TResult>(String, String, EntityResolver<TResult>, List<String>)

Adds a table operation to retrieve an entity of the specified class type with the specified partition key and row key to the batch operation.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an IEnumerator.

Extension Methods

ToCommaSeparatedString<T>(IEnumerable<T>)

Converts the elements of a collection to strings and concatenates them into a comma-separated list, or returns null for null or empty collections.

Applies to