Table of Contents

Class DateOnlyConverter

Namespace
Auth0.ManagementApi.Core
Assembly
Auth0.ManagementApi.dll

Custom converter for handling the System.DateOnly data type with the System.Text.Json library.

public sealed class DateOnlyConverter : JsonConverter<DateOnly>
Inheritance
JsonConverter<DateOnly>
DateOnlyConverter
Inherited Members
Extension Methods

Remarks

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type System.DateOnly.

public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

DateOnly

The converted value.

ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads a dictionary key from a JSON property name.

public override DateOnly ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The Utf8JsonReader to read from.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

The options to use when reading the value.

Returns

DateOnly

The value that was converted.

Write(Utf8JsonWriter, DateOnly, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value DateOnly

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.

WriteAsPropertyName(Utf8JsonWriter, DateOnly, JsonSerializerOptions)

Writes a dictionary key as a JSON property name.

public override void WriteAsPropertyName(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The Utf8JsonWriter to write to.

value DateOnly

The value to convert. The value of HandleNull determines if the converter handles null values.

options JsonSerializerOptions

The options to use when writing the value.