Class ValueObjectJsonSerializerSettingsExtensions
Namespace: AdCodicem.ValueObjects.NewtonsoftJson
Assembly: AdCodicem.ValueObjects.NewtonsoftJson.dll
Wires value object support into
public static class ValueObjectJsonSerializerSettingsExtensions
Inheritance
object ← ValueObjectJsonSerializerSettingsExtensions
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
AddValueObjects(JsonSerializerSettings, bool)
Adds
public static JsonSerializerSettings AddValueObjects(this JsonSerializerSettings settings, bool decimalReals = true)
Parameters
settings JsonSerializerSettings
Settings to configure.
decimalReals bool
true to set
Returns
JsonSerializerSettings
The same settings, so calls can be chained.
Remarks
Newtonsoft.Json reads each token under its settings before a converter sees it. This sets
12.50 would read back as 12.5, and
1234567890123456789.12 as 1234567890123456800. It applies to every number of the payload, so pass
false when a payload carries a
The converter is added once: a registration already in the settings is left alone.
It leaves