1

Closed

Deserialize<Dictionary<string,string>> changes true to True and false to False

description

Hi,
Trying to deserialize a simple JSON into a Dictionary<string,string> changes the casing of the booleans:
 
var data = "{\"is_purchased\":false,\"is_supplied\":true}";
 
var result = JsonConvert.DeserializeObject<Dictionary<string,string>>(data);
 
result["is_purchased"] is now "False" instead of "false".
result["is_supplied"] is now "True" instead of "true".
 
Is there an easy way to fix this?
 
Thanks,
Corneliu
Closed Jul 25, 2012 at 2:43 AM by JamesNK
The .NET string versions of true/false have capitals

comments