Table of Contents

Class JsonConverterCollectionExtensions

Namespace
Cuemon.Extensions.Newtonsoft.Json.Converters
Assembly
Cuemon.Extensions.Newtonsoft.Json.dll

Extension methods for the Newtonsoft.Json.JsonConverter class.

public static class JsonConverterCollectionExtensions
Inheritance
Object
JsonConverterCollectionExtensions

Methods

AddDataPairConverter(ICollection<JsonConverter>)

Adds an DataPair JSON converter to the list.

public static ICollection<JsonConverter> AddDataPairConverter(this ICollection<JsonConverter> converters)

Parameters

converters ICollection<JsonConverter>

The ICollection{JsonConverter} to extend.

Returns

ICollection<JsonConverter>

A reference to converters after the operation has completed.

AddExceptionConverter(ICollection<JsonConverter>, Boolean, Boolean)

Adds an System.Exception JSON converter to the list.

public static ICollection<JsonConverter> AddExceptionConverter(this ICollection<JsonConverter> converters, bool includeStackTrace, bool includeData)

Parameters

converters ICollection<JsonConverter>

The ICollection{JsonConverter} to extend.

includeStackTrace Boolean

The value that determine whether the stack of an exception is included in the converted result.

includeData Boolean

The value that determine whether the data of an exception is included in the converted result.

Returns

ICollection<JsonConverter>

A reference to converters after the operation has completed.

AddExceptionDescriptorConverterOf<T>(ICollection<JsonConverter>, Action<ExceptionDescriptorOptions>, Action<JsonWriter, T, JsonSerializer>, Action<JsonWriter, T, JsonSerializer>)

Adds an ExceptionDescriptor JSON converter to the list.

public static ICollection<JsonConverter> AddExceptionDescriptorConverterOf<T>(this ICollection<JsonConverter> converters, Action<ExceptionDescriptorOptions> setup = null, Action<JsonWriter, T, JsonSerializer> afterWriteErrorStartObject = null, Action<JsonWriter, T, JsonSerializer> beforeWriteEndObject = null)
    where T : ExceptionDescriptor

Parameters

converters ICollection<JsonConverter>

The ICollection{JsonConverter} to extend.

setup Action<ExceptionDescriptorOptions>

The ExceptionDescriptorOptions which may be configured.

afterWriteErrorStartObject Action<JsonWriter, T, JsonSerializer>

The delegate that is invoked just after writing JSON start object (Error).

beforeWriteEndObject Action<JsonWriter, T, JsonSerializer>

The delegate that is invoked just before writing the JSON end object.

Returns

ICollection<JsonConverter>

A reference to converters after the operation has completed.

Type Parameters

T

AddStringEnumConverter(ICollection<JsonConverter>, NamingStrategy)

Adds an System.Enum JSON converter to the list.

public static ICollection<JsonConverter> AddStringEnumConverter(this ICollection<JsonConverter> converters, NamingStrategy ns = null)

Parameters

converters ICollection<JsonConverter>

The ICollection{JsonConverter} to extend.

ns NamingStrategy

The optional Newtonsoft.Json.Serialization.NamingStrategy to apply.

Returns

ICollection<JsonConverter>

A reference to converters after the operation has completed.

AddStringFlagsEnumConverter(ICollection<JsonConverter>, NamingStrategy)

Adds a combined System.Enum and System.FlagsAttribute JSON converter to the list.

public static ICollection<JsonConverter> AddStringFlagsEnumConverter(this ICollection<JsonConverter> converters, NamingStrategy ns = null)

Parameters

converters ICollection<JsonConverter>

The ICollection{JsonConverter} to extend.

ns NamingStrategy

The optional Newtonsoft.Json.Serialization.NamingStrategy to apply.

Returns

ICollection<JsonConverter>

A reference to converters after the operation has completed.

AddTransientFaultExceptionConverter(ICollection<JsonConverter>)

Adds an System.Exception JSON converter to the list.

public static ICollection<JsonConverter> AddTransientFaultExceptionConverter(this ICollection<JsonConverter> converters)

Parameters

converters ICollection<JsonConverter>

The ICollection{JsonConverter} to extend.

Returns

ICollection<JsonConverter>

A reference to converters after the operation has completed.