I'm trying to use JSON.net to serialize a Dictionary.
Using
JsonConvert.SerializeObject(theDict);
Here is my result
{
"1": {
"Blah1": false,
"Blah2": false,
"Blah3": "None",
"Blah4": false
},
"2": {
"Blah1": false,
"Blah2": false,
"Blah3": "None",
"Blah4": false
},
"3": {
"Blah1": false,
"Blah2": false,
"Blah3": "None",
"Blah4": false
},
...
...
...
}
Is there a way to serialize this dictionary such that the keys are rendered as valid javascript variables?
I am also open to other strategies of serializing the dictionary.