Click or drag to resize
Json.NETSerialize an immutable collection
 

This sample serializes an immutable collection into JSON.

Sample
Usage
 1ImmutableList<string> l = ImmutableList.CreateRange(new List<string>
 2{
 3    "One",
 4    "II",
 5    "3"
 6});
 7
 8string json = JsonConvert.SerializeObject(l, Formatting.Indented);
 9// [
10//   "One",
11//   "II",
12//   "3"
13// ]