How to get property from dynamic JObject programmatically

Another way of targeting this is by using SelectToken (Assuming that you're using Newtonsoft.Json):

JObject json = GetResponse();
var name = json.SelectToken("items[0].name");

For a full documentation: https://www.newtonsoft.com/json/help/html/SelectToken.htm


Assuming you're using the Newtonsoft.Json.Linq.JObject, you don't need to use dynamic. The JObject class can take a string indexer, just like a dictionary:

JObject myResult = GetMyResult();
returnObject.Id = myResult["string here"]["id"];

Hope this helps!