Show / Hide Table of Contents

Class OptionalConverterFactory

Represents JSON converter for Optional<T> data type.

Inheritance
object
JsonConverter
JsonConverterFactory
OptionalConverterFactory
Inherited Members
JsonConverterFactory.Type
object.GetType()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Text.Json
Assembly: DotNext.dll
Syntax
[RequiresUnreferencedCode("This type instantiates OptionalConverter<T> dynamically. Use OptionalConverter<T> instead.")]
[RequiresDynamicCode("Runtime binding requires dynamic code compilation")]
public sealed class OptionalConverterFactory : JsonConverterFactory
Remarks

For AOT and self-contained app deployment models, use OptionalConverter<T> converter explicitly as an argument for JsonConverterAttribute.

Constructors

View Source

OptionalConverterFactory()

Declaration
public OptionalConverterFactory()

Methods

View Source

CanConvert(Type)

Declaration
public override bool CanConvert(Type typeToConvert)
Parameters
Type Name Description
Type typeToConvert
Returns
Type Description
bool
Overrides
JsonConverter.CanConvert(Type)
View Source

CreateConverter(Type, JsonSerializerOptions)

Declaration
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
Parameters
Type Name Description
Type typeToConvert
JsonSerializerOptions options
Returns
Type Description
JsonConverter
Overrides
JsonConverterFactory.CreateConverter(Type, JsonSerializerOptions)

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾