title: How can I check if Json matches a specific C# type?
body: <p>My Asp.Net MVC application action is returning JSON by serializing one of several C# objects, depending on the circumstances (if an error occurred, one data type if one type of data was retrieved, etc...).</p>
  
  <p>When I try to consume the JSON in a C# windows service, I am having trouble trying to figure out what type of JSON is being returned.  Unfortunately from what I have seen, JSON serializers (JSON.Net and whatever RestSharp uses) all have no problem creating an empty object if none of the JSON matches.  </p>
  
  <p>I understand why this happens, but I am confused on how to figure out if the values serialized from JSON are legit, or if none of the JSON properties matched and the serializer just created an empty object.</p>
  
  <p>Does anyone know how I would determine if a match exists between JSON and the type I am trying to deserialize to?</p>