Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 663 Bytes

SerializeImmutableCollections.md

File metadata and controls

23 lines (20 loc) · 663 Bytes

Serialize an immutable collection

This sample serializes an immutable collection into JSON.

var l = ImmutableList.CreateRange(new List<string>
{
    "One",
    "II",
    "3"
});

var json = JsonConvert.SerializeObject(l, Formatting.Indented);
// [
//   "One",
//   "II",
//   "3"
// ]

snippet source | anchor