Converter

Prev Next

Contracts

Contract Description
EmptyStringToNullConverter
LocalizedContractResolver A Json.NET contract resolver that localizes property names using DisplayAttribute and ensures enums are serialized using a display-name based converter. Usage: var settings = new JsonSerializerSettings { ContractResolver = new LocalizedDisplayNameContractResolver(CultureInfo.GetCultureInfo("de")) }; JsonConvert.SerializeObject(obj, settings);
LocalizedEnumConverter Json.NET converter that writes enum values as localized display names. Resolution order: 1) DisplayAttribute on enum member (ResourceType + Name) 2) ResourceManager discovered on enum type via custom attribute (e.g., ResourceManagerAttribute) 3) Fallback to raw enum name Deserialization is intentionally not implemented.
TolerantEnumConverter We use this converter in order to extend in the future enum entries without breaking the deserialization of old assembly versions See also: https://stackoverflow.com/questions/22752075/how-can-i-ignore-unknown-enum-values-during-json-deserialization