Answers for "c# newtonsoft serialize dictionary to json"

1

c# newtonsoft serialize dictionary to json

Dictionary<string, int> points = new Dictionary<string, int>
{
    { "James", 9001 },
    { "Jo", 3474 },
    { "Jess", 11926 }
};

string json = JsonConvert.SerializeObject(points, Formatting.Indented);

Console.WriteLine(json);
// {
//   "James": 9001,
//   "Jo": 3474,
//   "Jess": 11926
// }
Posted by: Guest on September-14-2020

Code answers related to "c# newtonsoft serialize dictionary to json"

Code answers related to "Javascript"

Browse Popular Code Answers by Language