I'd like to check if the json object deserialized using Newtonsoft is empty. I am using this code which feels a little hacky:
try{
dynamic jsonObject = JsonConvert.DeserializeObject(jsonString);
dynamic content = jsonObject.content.important;
if (((JObject)content).ToString() != "{}"){ // inspecting if "imporant" has value
// do stuff
}
}catch(Exception e){
// handle error
}
Is there a more "stylist" approach to inspecting if object exists?