Table of Contents

Class JsonConverterExtensions

Namespace
Savvyio.Extensions.Text.Json
Assembly
Savvyio.Extensions.Text.Json.dll

Extension methods for the JsonConverter class.

public static class JsonConverterExtensions
Inheritance
JsonConverterExtensions

Methods

AddDateTimeConverter(ICollection<JsonConverter>)

Adds a DateTime converter to the collection.

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

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

AddDateTimeOffsetConverter(ICollection<JsonConverter>)

Adds a DateTimeOffset converter to the collection.

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

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

AddMessageConverter(ICollection<JsonConverter>)

Adds an IMessage<T> converter (or derived) to the collection.

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

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

AddMetadataDictionaryConverter(ICollection<JsonConverter>)

Adds a IMetadataDictionary converter to the collection.

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

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

AddRequestConverter(ICollection<JsonConverter>)

Adds a IRequest converter to the collection.

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

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

AddSingleValueObjectConverter(ICollection<JsonConverter>)

Adds a SingleValueObject<T> converter to the collection.

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

Parameters

converters ICollection<JsonConverter>

The collection to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

RemoveAllOf(ICollection<JsonConverter>, params Type[])

Removes one or more JsonConverter implementations where CanConvert(Type) evaluates true in the collection of converters.

public static ICollection<JsonConverter> RemoveAllOf(this ICollection<JsonConverter> converters, params Type[] types)

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

types Type[]

The type of objects or values handled by a sequence of JsonConverter.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Exceptions

ArgumentNullException

converters cannot be null.

RemoveAllOf<T>(ICollection<JsonConverter>)

Removes one or more JsonConverter implementations where CanConvert(Type) evaluates true in the collection of converters.

public static ICollection<JsonConverter> RemoveAllOf<T>(this ICollection<JsonConverter> converters)

Parameters

converters ICollection<JsonConverter>

The collection of JsonConverter to extend.

Returns

ICollection<JsonConverter>

A reference to converters so that additional calls can be chained.

Type Parameters

T

The type of object or value handled by the JsonConverter.

Exceptions

ArgumentNullException

converters cannot be null.