Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 735 Bytes

DeserializeImmutableCollections.md

File metadata and controls

28 lines (23 loc) · 735 Bytes

Deserialize an immutable collection

This sample deserializes JSON into an immutable collection.

var json = """
           [
             'One',
             'II',
             '3'
           ]
           """;

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

foreach (var s in l)
{
    Console.WriteLine(s);
}

// One
// II
// 3

snippet source | anchor