Cannot access properties after JSON deserialization into dynamic
You can deserialize your JSON to JObject
instead of dynamic
, then you can access the property by property name dynamically, for example :
JObject jObject = JsonConvert.DeserializeObject<JObject>(response);var user = "511221";var structures = jObject["user"][user]["structures"][0];//given JSON input as in this question, //following line will print "structure.62dd1ff1-f96b-22e3-8d4e-22000c20725r"Console.WriteLine(structures);