deserialize json to dynamic object c#

66

json.net deserialize dynamic -

dynamic d = JObject.Parse("{number:1000, str:'string', array: [1,2,3,4,5,6]}");

Console.WriteLine(d.number);
Console.WriteLine(d.str);
Console.WriteLine(d.array.Count);

deserialize json to dynamic object c# -

dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(jsonObject, expConverter);

json.net deserialize dynamic -

dynamic d = JObject.Parse("{number:1000, str:'string', array: [1,2,3,4,5,6]}");

Console.WriteLine(d.number);
Console.WriteLine(d.str);
Console.WriteLine(d.array.Count);

Comments

Submit
0 Comments