Deserialize an immutable collection |
This sample deserializes JSON into an immutable collection.
string json = @"[ 'One', 'II', '3' ]"; ImmutableList<string> l = JsonConvert.DeserializeObject<ImmutableList<string>>(json); foreach (string s in l) { Console.WriteLine(s); } // One // II // 3