I'm trying to serialize a nested dictionary of int arrays (<int[], <int[], int>>
) with Json.net but when I run it through the serializer:
string dumpFile = JsonConvert.SerializeObject(chordChain, Formatting.Indented);
I get this:
{
"Int32[] Array": {
"Int32[] Array": 10,
"Int32[] Array": 100,
"Int32[] Array": 50
},
"Int32[] Array": {
"Int32[] Array": 50,
"Int32[] Array": 10,
"Int32[] Array": 100
},
"Int32[] Array": {
"Int32[] Array": 100,
"Int32[] Array": 50,
"Int32[] Array": 10
}
}
What I was expecting was:
{
"[0, 4, 7]": {
"[0, 4, 7]": 10,
"[5, 9, 0]": 100,
"[7, 11, 2]": 50
},
"[5, 9, 0]": {
"[0, 4, 7]": 50,
"[5, 9, 0]": 10,
"[7, 11, 2]": 100
},
"[7, 11, 2]": {
"[0, 4, 7]": 100,
"[5, 9, 0]": 50,
"[7, 11, 2]": 10
}
}
Should Json.net serialize this? If so, what do I need to do?
Thanks.