Show / Hide Table of Contents

    Class JsonOptionsExtensions

    Extensions to configure Json serialization options

    Inheritance
    System.Object
    JsonOptionsExtensions
    Namespace: Dangl.Data.Shared.Json
    Assembly: Dangl.Data.Shared.dll
    Syntax
    public static class JsonOptionsExtensions : object

    Methods

    | Improve this Doc View Source

    ConfigureDefaultJsonSerializerSettings(JsonSerializerSettings)

    This enables the Newtonsoft.Json.Converters.StringEnumConverter, sets Newtonsoft.Json.NullValueHandling to ignore, and adds the DefaultValuesContractResolver to ignore default values for certain types, e.g. Guid.Empty, DateTime.MinValue and DateTimeOffset.MinValue

    Declaration
    public static void ConfigureDefaultJsonSerializerSettings(this JsonSerializerSettings jsonSerializerSettings)
    Parameters
    Type Name Description
    Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings
    | Improve this Doc View Source

    ConfigureDefaultJsonSerializerSettings(JsonSerializerSettings, Boolean)

    This enables the Newtonsoft.Json.Converters.StringEnumConverter, sets Newtonsoft.Json.NullValueHandling to ignore, and adds the DefaultValuesContractResolver to ignore default values for certain types, e.g. Guid.Empty, DateTime.MinValue and DateTimeOffset.MinValue

    Declaration
    public static void ConfigureDefaultJsonSerializerSettings(this JsonSerializerSettings jsonSerializerSettings, bool useCamelCaseContractResolver)
    Parameters
    Type Name Description
    Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings
    System.Boolean useCamelCaseContractResolver

    If this is set to true, property names will be serialized using CamelCase

    • Improve this Doc
    • View Source
    Back to top © Dangl IT GmbH