When trying to Console.Writeline the output of a DynamoDB query (a document), I get "Amazon.DynamoDBv2.DocumentModel.DynamoDBBool" instead of the "true" or "False" value. How to print the correct ToString() representation of any given value coming from DynamoDB whether its a string or int or boolean.
foreach (var resultDocument in resultDocs)
{
foreach (var resultDocItem in resultDocument)
{
printString += $",{resultDocItem.Value.ToString()}";
}
}
This code prints "Amazon.DynamoDBv2.DocumentModel.DynamoDBBool" when a boolean value is hit rather than 'true' or 'false'