first time asking questions here.
I currently have a Dictionary in C# that I want to serialize into JSON using:
Dictionary<string, List<string> myDict = new Dictionary<string, List<string>();
string json = JsonConvert.SerializeObject(myDict);
Works A1, getting results
{"Key1":["Item1","Item2","Item3"],"Key2":["Item1","Item2","Item3"]}
However, I would like to get my JSON response in this format to be usable with Jquery addons:
{"ID":"Key1", "Value": ["Val":"Item1","Val:":"Item2","Val":"Item3"] }, { "ID":"Key2", "Value":["Val":"Item1","Val:":"Item2","Val":"Item3"] }
Without having to loop through the dictionary and rebuild it manually. Is there any decent ways to do it?
Thank you