String/json to dictionary (without using Microsoft.Activities.Extensions)

hello there,

how can a string or json object be converted into a dictionary ? below is the input string i have and i want to create a dictionary out of it, but without using the microsoft extension activities. basically i was trying to understand how to convert an object into a dictionary using the ToDictionary() method

{"firstName":"jane","last":"doe","email":"jane@oranges.com","handy":"7854415252","city":"paris","gender":"female","submit":true}

appreciate your inputs
hara

JsonConvert.Deserialize

1 Like

@Hara_Gopal -
project -> dependencies-> add json.net and try below snippet —

example :

string json = @"{""key1"":""value1"",""key2"":""value2""}";

var values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
2 Likes