Table of Contents

Class Response<T>

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

The cosmos resource response class

public abstract class Response<T>

Type Parameters

T
Inheritance
Response<T>
Derived
Inherited Members
Extension Methods

Constructors

Response()

protected Response()

Properties

ActivityId

Gets the activity ID for the request from the Azure Cosmos DB service.

public abstract string ActivityId { get; }

Property Value

string

The activity ID for the request.

Diagnostics

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

public abstract CosmosDiagnostics Diagnostics { get; }

Property Value

CosmosDiagnostics

ETag

Gets the entity tag associated with the resource from the Azure Cosmos DB service.

public abstract string ETag { get; }

Property Value

string

The entity tag associated with the resource.

Remarks

ETags are used for concurrency checking when updating resources.

Headers

Gets the current ResponseMessage HTTP headers.

public abstract Headers Headers { get; }

Property Value

Headers

RequestCharge

Gets the request charge for this request from the Azure Cosmos DB service.

public abstract double RequestCharge { get; }

Property Value

double

The request charge measured in request units.

Resource

The content of the response.

public abstract T Resource { get; }

Property Value

T

StatusCode

Gets the request completion status code from the Azure Cosmos DB service. This can be used to in scenario like CreateDatabaseIfNotExists to help determine if the database was created or already existed.

public abstract HttpStatusCode StatusCode { get; }

Property Value

HttpStatusCode

The request completion status code

Remarks

This is only used for success scenarios. The operation will throw a CosmosException on failures. For more info: https://aka.ms/cosmosdb-dot-net-exceptions

Operators

implicit operator T(Response<T>)

Get Resource implicitly from Response<T>

public static implicit operator T(Response<T> response)

Parameters

response Response<T>

The Azure Cosmos DB service response.

Returns

T