Checking for key name in nested json Checking for key name in nested json json json

Checking for key name in nested json


If the property to be checked is always belong to an item in the value property, then you can do this way :

var isQualityExists =             content["value"].Any(v => ((JObject)v).Properties()                                                  .Any(p => p.Name.Contains("quality"))                                );

Otherwise, you may want to create a function that recursively check for a specific property name existence all over the JObject.


date does not exist in json. Thats why you get false as mentioned in one of the comments.If you want to search for key:"to"

if("to" in json_object) {//your logic goes here}