Class JsonStringDateOnlyConverter
- Namespace
- Visus.AddressValidation.Serialization.Json
- Assembly
- Visus.AddressValidation.dll
Converts JSON strings representing dates to and from Nullable<T>.
public sealed class JsonStringDateOnlyConverter : JsonConverter<DateOnly?>
- Inheritance
-
JsonStringDateOnlyConverter
- Inherited Members
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type Nullable.
public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
readerUtf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.
Returns
- Nullable
The converted value.
Write(Utf8JsonWriter, DateOnly?, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, DateOnly? value, JsonSerializerOptions options)
Parameters
writerUtf8JsonWriterThe writer to write to.
valueNullableThe value to convert to JSON.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.