Deserializing with Json.NET: Requiring a property/key to be present
问题 When using Json.NET to deserialize a JSON string into an object, how do I require a key/property to be present in the JSON stirng, but allow for NULL values? For example: Lets say I have a class/object... [DataContract] public class Car { [DataMember(IsRequired = true)] public string Vin {get; set;} [DataMember(IsRequired = true)] public string Color {get; set;} public string Description {get; ;set} } In the above example, the VIN and Color are required, and an exception would be thrown if