Click or drag to resize
Json.NETSerialize a Collection
 

This sample serializes a collection to JSON.

Sample
Usage
 1List<string> videogames = new List<string>
 2{
 3    "Starcraft",
 4    "Halo",
 5    "Legend of Zelda"
 6};
 7
 8string json = JsonConvert.SerializeObject(videogames);
 9
10Console.WriteLine(json);
11// ["Starcraft","Halo","Legend of Zelda"]