I'm using dynamoDB with the C# driver and I have a table with Users. The table has the following two primary keys:
- Primary Hash Key: UserId (Number)
- Primary Range Key: Created (String)
Then I try to load a User using the Load method on the context like this:
_dynamoDBClient.Context.Load<User>(12345);
I then end up with the following exception:
"exceptionMessage": "Unable to convert range key value for property Created", "exceptionType": "System.InvalidOperationException"
If I load with the specific range key like:
_dynamoDBClient.Context.Load<User>(12345, "2015-01-01");
Everything is ok.
Isn't there a way to load a typed user only using the primary hash key, even though the table has a range key? I don't want to send in the creation date every time I need to get a user. Or have I missunderstood the concept of range keys in dynamoDB?