help with output structure

Feb 18, 2009 at 1:38 AM
Edited Feb 18, 2009 at 1:39 AM

I have managed to output the following using SerializeObject:


I'm looking for the following structured output but don't know how to go about it:


"keys": ["abb_key0", "abb_key1", "abb_keyn"],

"abb_key0": { "name": String,"abbreviation": String },
"abb_key1": { "name": String,"abbreviation": String },
"abb_keyn": { "name": String,"abbreviation": String }


Any direction would be appreciated! I'm using - but if you only have a C# example I will convert.

Thanks so much in advance.

Feb 18, 2009 at 2:54 AM
To get JSON in that custom format you will need to manually write it.

I would recommend creating LINQ to JSON objects in the desired structure and then using ToString to get the JSON text.
Feb 19, 2009 at 5:58 PM
Is there any possibility of you providing sample code for how this is done? I haven't been able to structure it the same as I need and it's killing me!