How to use ReturnValuesOnConditionCheckFailure in the .NET SDK? #2994
-
I have searched for a feature called I want to use it to determine whether the I have tried to find out how to use it in the .NET SDK, but I'm not sure if it can be used in the .NET SDK yet. Could you please let me know how to use it in the .NET SDK with optimistic locking? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's available in the .NET SDK, but you need to update the 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/ |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
It's available in the .NET SDK, but you need to update the
DynamoDBv2
package to at least version3.7.105.0
(that's when the new parameter was added):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/