Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 728 Bytes

DeserializeDictionary.md

File metadata and controls

24 lines (19 loc) · 728 Bytes

Deserialize a Dictionary

This sample deserializes JSON into a dictionary.

var json = """
    {
      'href': '/account/login.aspx',
      'target': '_blank'
    }
    """;

var htmlAttributes = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

Console.WriteLine(htmlAttributes["href"]);
// /account/login.aspx

Console.WriteLine(htmlAttributes["target"]);
// _blank

snippet source | anchor