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

DefaultContractResolver

Used by JsonSerializer to resolves a JsonContract for a given Type.

Gets or sets the default members search flags.

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 IgnoreSerializableAttribute { get; set; }

Gets or sets a value indicating whether to ignore the SerializableAttribute attribute when serializing and deserializing types.

public bool IgnoreSerializableInterface { get; set; }

Gets or sets a value indicating whether to ignore the ISerializable interface when serializing and deserializing types.

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.

public DefaultContractResolver(bool shareCache)

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.

Creates a JsonISerializableContract 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.