Skip to content

How to use ReturnValuesOnConditionCheckFailure in the .NET SDK? #2994

Answered by dscpinheiro
psh9508 asked this question in Q&A
Discussion options

You must be logged in to vote

It's available in the .NET SDK, but you need to update the DynamoDBv2 package to at least version 3.7.105.0 (that's when the new parameter was added):

using Amazon.DynamoDBv2.Model;

// Also available in UpdateItem, DeleteItem, ExecuteStatement, BatchExecuteStatement and ExecuteTransaction APIs.
var request = new PutItemRequest
{
    ReturnValuesOnConditionCheckFailure = ReturnValuesOnConditionCheckFailure.ALL_OLD
};

I don't believe we have a sample in C#, but this blog post has examples in Python and the APIs (like I mentioned above) are available in .NET as well: https://aws.amazon.com/blogs/database/handle-conditional-write-errors-in-high-concurrency-scenarios-with-amazon-dynamodb/

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by psh9508
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants