How to check whether json object has some property
Just use obj["proprty_name"]. If the property doesn't exist, it returns null
if(obj["proprty_name"] != null){
// do something
}
You can try like this:
IDictionary<string, JToken> dict = x;
if (dict.ContainsKey("some_key"))
since JSONObject
implements IDictionary<string, JToken>
. You can refer MSDN for details