Click or drag to resize
Json.NET

Deserialize an immutable collection

 

This sample deserializes JSON into an immutable collection.

Sample
Usage
string json = @"[
  'One',
  'II',
  '3'
]";

ImmutableList<string> l = JsonConvert.DeserializeObject<ImmutableList<string>>(json);

foreach (string s in l)
{
    Console.WriteLine(s);
}
// One
// II
// 3