Open BryanCrotaz opened 1 year ago
@BryanCrotaz You need to change the
return dynamoContext.DeleteAsync<string>(id, operationConfig);
to
return dynamoContext.DeleteAsync<WebsocketConnectionDB>(id, operationConfig);
The generic parameter is used to identify the type and find the table's metadata.
Interesting - that's not what the signature says.
DeleteAsync<TId>(TId id ...
That implies that the type is the type of the hash key. The other overload is
DeleteAsync<TModel>(TModel entity ...
Your suggestion works but there's no way I would have guessed that from the signature and the docs.
In all of the methods the generic parameter is the type of the entity you are working with. Otherwise the library has no context where you are deleting that string
from.
I agree the nDoc for that parameter could be a lot more clear. I'm going to turn this into a feature request to update the generic parameter documentation in the code.
Describe the bug
The data table
The code - delete a row based on the hash
Expected Behavior
Expected the row with that hash Id to be deleted
Current Behavior
Exception, see above
Reproduction Steps
See above
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.DynamoDBv2 3.7.103.8
Targeted .NET Platform
.Net 6
Operating System and version
AWS Lambda