Noda Time
Show / Hide Table of Contents

Class NodaTimeDefaultJsonConverterFactory

Provides JSON default converters for Noda Time types, as if using serializer options configured by ConfigureForNodaTime(JsonSerializerOptions, IDateTimeZoneProvider) with a provider of Tzdb.
Since 3.2.x
Availability net6.0, netstandard2.0
Inheritance
object
JsonConverter
JsonConverterFactory
NodaTimeDefaultJsonConverterFactory
Inherited Members
JsonConverterFactory.Type
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NodaTime.Serialization.SystemTextJson
Assembly: NodaTime.Serialization.SystemTextJson.dll
Syntax
public sealed class NodaTimeDefaultJsonConverterFactory : JsonConverterFactory
Remarks
This is a factory equivalent of NodaTimeDefaultJsonConverterAttribute.

Constructors

NodaTimeDefaultJsonConverterFactory()

Constructs an instance of the factory.
Since 3.2.x
Availability net6.0, netstandard2.0
Declaration
public NodaTimeDefaultJsonConverterFactory()

Methods

CanConvert(Type)

When overridden in a derived class, determines whether the converter instance can convert the specified object type.
Since 3.2.x
Availability net6.0, netstandard2.0
Declaration
public override bool CanConvert(Type typeToConvert)
Parameters
Type Name Description
Type typeToConvert The type of the object to check whether it can be converted by this converter instance.
Returns
Type Description
bool true if the instance can convert the specified object type; otherwise, false.
Overrides
JsonConverter.CanConvert(Type)

CreateConverter(Type, JsonSerializerOptions)

Creates a converter for a specified type.
Since 3.2.x
Availability net6.0, netstandard2.0
Declaration
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
Parameters
Type Name Description
Type typeToConvert The type handled by the converter.
JsonSerializerOptions options The serialization options to use.
Returns
Type Description
JsonConverter A converter for which T is compatible with typeToConvert.
Overrides
JsonConverterFactory.CreateConverter(Type, JsonSerializerOptions)
In this article
Back to top Generated by DocFX