Table of Contents

Class TransactionalBatchResponse

Namespace
Microsoft.Azure.Cosmos
Assembly
Microsoft.Azure.Cosmos.Client.dll

Response of a TransactionalBatch request.

public class TransactionalBatchResponse : IReadOnlyList<TransactionalBatchOperationResult>, IReadOnlyCollection<TransactionalBatchOperationResult>, IEnumerable<TransactionalBatchOperationResult>, IEnumerable, IDisposable
Inheritance
TransactionalBatchResponse
Implements
Inherited Members
Extension Methods

Constructors

TransactionalBatchResponse()

Initializes a new instance of the TransactionalBatchResponse class.

protected TransactionalBatchResponse()

Properties

ActivityId

Gets the ActivityId that identifies the server request made to execute the batch.

public virtual string ActivityId { get; }

Property Value

string

Count

Gets the number of operation results.

public virtual int Count { get; }

Property Value

int

Diagnostics

Gets the cosmos diagnostic information for the current request to Azure Cosmos DB service

public virtual CosmosDiagnostics Diagnostics { get; }

Property Value

CosmosDiagnostics

ErrorMessage

Gets the reason for failure of the batch request.

public virtual string ErrorMessage { get; }

Property Value

string

The reason for failure, if any.

Headers

Gets the current HTTP headers.

public virtual Headers Headers { get; }

Property Value

Headers

IsSuccessStatusCode

Gets a value indicating whether the batch was processed.

public virtual bool IsSuccessStatusCode { get; }

Property Value

bool

this[int]

Gets the result of the operation at the provided index in the batch.

public virtual TransactionalBatchOperationResult this[int index] { get; }

Parameters

index int

0-based index of the operation in the batch whose result needs to be returned.

Property Value

TransactionalBatchOperationResult

Result of operation at the provided index in the batch.

RequestCharge

Gets the request charge for the batch request.

public virtual double RequestCharge { get; }

Property Value

double

The request charge measured in request units.

RetryAfter

Gets the amount of time to wait before retrying this or any other request within Cosmos container or collection due to throttling.

public virtual TimeSpan? RetryAfter { get; }

Property Value

TimeSpan?

StatusCode

Gets the completion status code of the batch request.

public virtual HttpStatusCode StatusCode { get; }

Property Value

HttpStatusCode

The request completion status code.

Methods

Dispose()

Disposes the current TransactionalBatchResponse.

public void Dispose()

Dispose(bool)

Disposes the disposable members held by this class.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Indicates whether to dispose managed resources or not.

GetEnumerator()

Gets an enumerator over the operation results.

public virtual IEnumerator<TransactionalBatchOperationResult> GetEnumerator()

Returns

IEnumerator<TransactionalBatchOperationResult>

Enumerator over the operation results.

GetOperationResultAtIndex<T>(int)

Gets the result of the operation at the provided index in the batch - the returned result has a Resource of provided type.

public virtual TransactionalBatchOperationResult<T> GetOperationResultAtIndex<T>(int index)

Parameters

index int

0-based index of the operation in the batch whose result needs to be returned.

Returns

TransactionalBatchOperationResult<T>

Result of batch operation that contains a Resource deserialized to specified type.

Type Parameters

T

Type to which the Resource in the operation result needs to be deserialized to, when present.