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
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot be null.
AddDateTimeOffsetConverter(ICollection<JsonConverter>)
Adds a DateTimeOffset converter to the collection.
public static ICollection<JsonConverter> AddDateTimeOffsetConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot 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
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot be null.
AddMetadataDictionaryConverter(ICollection<JsonConverter>)
Adds a IMetadataDictionary converter to the collection.
public static ICollection<JsonConverter> AddMetadataDictionaryConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot be null.
AddRequestConverter(ICollection<JsonConverter>)
Adds a IRequest converter to the collection.
public static ICollection<JsonConverter> AddRequestConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot be null.
AddSingleValueObjectConverter(ICollection<JsonConverter>)
Adds a SingleValueObject<T> converter to the collection.
public static ICollection<JsonConverter> AddSingleValueObjectConverter(this ICollection<JsonConverter> converters)
Parameters
convertersICollection<JsonConverter>The collection to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot 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
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
typesType[]The type of objects or values handled by a sequence of JsonConverter.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Exceptions
- ArgumentNullException
converterscannot 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
convertersICollection<JsonConverter>The collection of JsonConverter to extend.
Returns
- ICollection<JsonConverter>
A reference to
convertersso that additional calls can be chained.
Type Parameters
TThe type of object or value handled by the JsonConverter.
Exceptions
- ArgumentNullException
converterscannot be null.