Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ItemResponse<ToDoActivity> readItemResponse = await this.container.ReadItemAsync(
id: "<id>",
new PartitionKey("<partitionKeyValue>"));
ToDoActivity someItem = readItemResponse.Resource;
// Apply some modification
someItem.value = 5;
ItemResponse<ToDoActivity> itemResponse = await this.container.ReplaceItemAsync<ToDoActivity>(
id: "<id>",
item: someItem,
new PartitionKey("<partitionKeyValue>"),
requestOptions : new ItemRequestOptions() { EnableContentResponseOnWrite = false });
ToDoActivity responseContent = itemResponse.Resource; // <-- This will be null now
double consumedRus = itemResponse.Headers.RequestCharge;
string etag = itemResponse.Headers.ETag;
string session = itemResponse.Headers.Session;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment