Click or drag to resize
Json.NETDeserialize an immutable collection
 

This sample deserializes JSON into an immutable collection.

Sample
Usage
 1string json = @"[
 2  'One',
 3  'II',
 4  '3'
 5]";
 6
 7ImmutableList<string> l = JsonConvert.DeserializeObject<ImmutableList<string>>(json);
 8
 9foreach (string s in l)
10{
11    Console.WriteLine(s);
12}
13// One
14// II
15// 3