Class JsonConverterCollectionExtensions
- Namespace
- Codebelt.Extensions.Newtonsoft.Json.Converters
- Assembly
- Codebelt.Extensions.Newtonsoft.Json.dll
Extension methods for the Newtonsoft.Json.JsonConverter class.
public static class JsonConverterCollectionExtensions
- Inheritance
-
JsonConverterCollectionExtensions
Methods
AddDataPairConverter(ICollection<JsonConverter>)
Adds an DataPair JSON converter to the list.
public static ICollection<JsonConverter> AddDataPairConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter the operation has completed.
AddExceptionConverter(ICollection<JsonConverter>, bool, bool)
Adds an Exception JSON converter to the list.
public static ICollection<JsonConverter> AddExceptionConverter(this ICollection<JsonConverter> converters, bool includeStackTrace, bool includeData)
Parameters
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
includeStackTraceboolThe value that determine whether the stack of an exception is included in the converted result.
includeDataboolThe value that determine whether the data of an exception is included in the converted result.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter 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
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
setupAction<ExceptionDescriptorOptions>The ExceptionDescriptorOptions which may be configured.
afterWriteErrorStartObjectAction<JsonWriter, T, JsonSerializer>The delegate that is invoked just after writing JSON start object (
Error).beforeWriteEndObjectAction<JsonWriter, T, JsonSerializer>The delegate that is invoked just before writing the JSON end object.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter the operation has completed.
Type Parameters
T
AddFailureConverter(ICollection<JsonConverter>)
Adds a Failure JSON converter to the list.
public static ICollection<JsonConverter> AddFailureConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter the operation has completed.
AddStringEnumConverter(ICollection<JsonConverter>, NamingStrategy)
Adds an Enum JSON converter to the list.
public static ICollection<JsonConverter> AddStringEnumConverter(this ICollection<JsonConverter> converters, NamingStrategy ns = null)
Parameters
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
nsNamingStrategyThe optional Newtonsoft.Json.Serialization.NamingStrategy to apply.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter the operation has completed.
AddStringFlagsEnumConverter(ICollection<JsonConverter>, NamingStrategy)
Adds a combined Enum and FlagsAttribute JSON converter to the list.
public static ICollection<JsonConverter> AddStringFlagsEnumConverter(this ICollection<JsonConverter> converters, NamingStrategy ns = null)
Parameters
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
nsNamingStrategyThe optional Newtonsoft.Json.Serialization.NamingStrategy to apply.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter the operation has completed.
AddTransientFaultExceptionConverter(ICollection<JsonConverter>)
Adds an TransientFaultException JSON converter to the list.
public static ICollection<JsonConverter> AddTransientFaultExceptionConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The ICollection{JsonConverter} to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersafter the operation has completed.