<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

DefaultContractResolver

Used by JsonSerializer to resolve a JsonContract for a given Type.
public bool DynamicCodeGeneration { get; }

Gets a value indicating whether members are being get and set using dynamic code generation. This value is determined by the runtime permissions available.

public bool IgnoreIsSpecifiedMembers { get; set; }

Gets or sets a value indicating whether to ignore IsSpecified members when serializing and deserializing types.

public bool IgnoreShouldSerializeMembers { get; set; }

Gets or sets a value indicating whether to ignore ShouldSerialize members when serializing and deserializing types.

public NamingStrategy NamingStrategy { get; set; }

Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized.

public bool SerializeCompilerGeneratedMembers { get; set; }

Gets or sets a value indicating whether compiler generated members should be serialized.

Initializes a new instance of the DefaultContractResolver class.

protected virtual JsonArrayContract CreateArrayContract(Type objectType)

Creates a JsonArrayContract for the given type.

protected virtual IList<JsonProperty> CreateConstructorParameters(ConstructorInfo constructor, JsonPropertyCollection memberProperties)

Creates the constructor parameters.

protected virtual JsonContract CreateContract(Type objectType)

Determines which contract type is created for the given type.

Creates a JsonDictionaryContract for the given type.

protected virtual JsonDynamicContract CreateDynamicContract(Type objectType)

Creates a JsonDynamicContract for the given type.

protected virtual JsonLinqContract CreateLinqContract(Type objectType)

Creates a JsonLinqContract for the given type.

Creates the IValueProvider used by the serializer to get and set values from a member.

protected virtual JsonObjectContract CreateObjectContract(Type objectType)

Creates a JsonObjectContract for the given type.

protected virtual JsonPrimitiveContract CreatePrimitiveContract(Type objectType)

Creates a JsonPrimitiveContract for the given type.

protected virtual IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)

Creates properties for the given JsonContract.

protected virtual JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)

Creates a JsonProperty for the given MemberInfo.

protected virtual JsonProperty CreatePropertyFromConstructorParameter(JsonProperty matchingMemberProperty, ParameterInfo parameterInfo)

Creates a JsonProperty for the given ParameterInfo.

protected virtual JsonStringContract CreateStringContract(Type objectType)

Creates a JsonStringContract for the given type.

public string GetResolvedPropertyName(string propertyName)

Gets the resolved name of the property.

protected virtual List<MemberInfo> GetSerializableMembers(Type objectType)

Gets the serializable members for the type.

public virtual JsonContract ResolveContract(Type type)

Resolves the contract for a given type.

protected virtual JsonConverter ResolveContractConverter(Type objectType)

Resolves the default JsonConverter for the contract.

protected virtual string ResolveDictionaryKey(string dictionaryKey)

Resolves the key of the dictionary. By default ResolvePropertyName is used to resolve dictionary keys.

protected virtual string ResolveExtensionDataName(string extensionDataName)

Resolves the name of the extension data. By default no changes are made to extension data names.

protected virtual string ResolvePropertyName(string propertyName)

Resolves the name of the property.