title: How can I easily determine if JsonConvert.DeserializeObject() found and set every propery in my object?
body: <p>I'm using the json.net package to serialize/deserialize settings to file.  I'd like a way to ensure that when I deserialize, that a value was found in the json string for every property in my class.  There is a way to have json.net throw an exception if a property is found that is not a member of the class, but the reverse isn't true.
  For example:</p>
  
  <pre><code>public class Params
  {
      public double ReqPress = 5.0;
      public double LaserTransmission = 0.0;
      public int LaserShotCount = 1;
  
      public override string ToString()
      {
          return JsonConvert.SerializeObject(this, Formatting.Indented);
      }
      public static OperationalParams FromString(string jsonData)
      {
          var s = new JsonSerializerSettings();
          s.MissingMemberHandling = MissingMemberHandling.Error; 
          return JsonConvert.DeserializeObject&lt;OperationalParams&gt;(jsonData, s);
      }
  }
  </code></pre>
  
  <p>If I call</p>
  
  <pre><code>OperationalParams.FromString("{ ReqPress : 5.0, LaserTransmission : 0.0 }"), 
  </code></pre>
  
  <p>then I want to get an error telling me that LaserShotCount was missing and did not get initialized from the json data.  Ideally, JsonConvert.DeserializeObject would throw an exception if one or more members were missing, but that doesn't seem to be supported.  Is there another way to do this?  </p>