Service Contract Resolver. Create Object Contract(Type) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a Newtonsoft.Json.Serialization.JsonObjectContract that provides information about how the given type should be serialized to JSON.
protected override Newtonsoft.Json.Serialization.JsonObjectContract CreateObjectContract (Type objectType);
override this.CreateObjectContract : Type -> Newtonsoft.Json.Serialization.JsonObjectContract
Protected Overrides Function CreateObjectContract (objectType As Type) As JsonObjectContract
The Newtonsoft.Json.Serialization.JsonObjectContract for the type.
This method is overridden in order to catch types that have System.Runtime.Serialization.DataMemberAttribute on one or more members without having a System.Runtime.Serialization.DataContractAttribute on the type itself. This used to be supported but no longer is and therefore an exception must be thrown for such types. The exception informs the developer about how to correctly attribute the type with the Newtonsoft.Json.JsonPropertyAttribute instead of the System.Runtime.Serialization.DataMemberAttribute.