Hey all I am trying to add (or merge if you want to call it that) a few List<IDictionary<string, object>>
that I have created that look like this:
List<IDictionary<string, object>> eachTblColumnProperties = new List<IDictionary<string, object>>
{
new Dictionary<string, object>
{{ "title", "Type" },{"name", "Type" },{ "type", "text" },{ "width", "80" },{ "align", "left" },
{ "filtering", "true" },{ "visible", "true" },{ "sorting", "true" }},
new Dictionary<string, object>
{{ "title", "Description" },{"name", "Description" },{ "type", "text" },{ "width", "80" },{ "align", "left" },
{ "filtering", "true" },{ "visible", "true" },{ "sorting", "true" }},
etc etc...........
};
I will have about 6 or so List< IDictionary< string, object>>
that I wish to turn into JSON (using json.net).
So the JSON output of all of them would look like this:
Currently I am just returning 1 List< IDictionary< string, object>>
called status
:
return JsonConvert.SerializeObject(
new { status = eachTblColumnProperties },
Formatting.Indented);
And like looks like:
{
"status" [{
"title":"Type",
"name":"Type",
"type":"text",
"width":"80",
"align":"left",
"filtering":"true",
"visible":"true",
"sorting":"true"
},{
"title":"Description",
"name":"Description",
"type":"text",
"width":"80",
"align":"left",
"filtering":"true",
"visible":"true",
"sorting":"true"
},{
... etc etc...
}]
}
And that works just fine but I need to be able to send all my List< IDictionary< string, object>>
within that one return call...
So something that looks like this:
{
"status": [{
"title": "Type",
"name": "Type",
"type": "text",
"width": "80",
"align": "left",
"filtering": "true",
"visible": "true",
"sorting": "true"
},
{
"title": "Description",
"name": "Description",
"type": "text",
"width": "80",
"align": "left",
"filtering": "true",
"visible": "true",
"sorting": "true"
},{
etc..etc...
}
],
"AnotherStatus": [{
"title": "Type",
"name": "Type",
"type": "text",
"width": "80",
"align": "left",
"filtering": "true",
"visible": "true",
"sorting": "true"
},
{
"title": "Description",
"name": "Description",
"type": "text",
"width": "80",
"align": "left",
"filtering": "true",
"visible": "true",
"sorting": "true"
}, {
etc... etc...
}
]
}