EfficientDynamoDb
EfficientDynamoDb copied to clipboard
PutItem ToItemAsync always returns null
Hello,
I am using your great library for one of my projects.
I have difficulties to create objects and get feedback that they have been created correctly so decided to use ToItemAsync (With WithReturnValues) and ToResponseAsync.
None of them work as "I expected".
- ToResponseAsync returns an object whose childs are all null. So no useful information
- ToItemAsync complains when I set
ReturnValues.AllNewtelling me only AllOld and None should be used. However, no matter what I use, null is always returned
I have setup a small repo for you with a demo.
https://github.com/wjax/DynamoDbRepository.Playground
To note also that in the doc, it reads ToEntityAsync instead of the actual ToItemAsync
Hey @wjax
ToItemAsync complains when I set ReturnValues.AllNew telling me only AllOld and None should be used.
DynamoDB doesn't allow to set ReturnValues.AllNew for PutItem because it makes no sense in the context of operation. If PutItem is completed successfully, your item is saved and equals the item you've passed in the request.
However, no matter what I use, null is always returned
There is a bug in parsing DDB response that is fixed in #191. In the new version, you'll be able to use either ToResponseAsync or ToItemAsync with ReturnValues.AllOld to get an item state before the update.
Many thanks!