Class DateOnlyJsonConverter
- Namespace
- Payetools.Common.Serialization
- Assembly
- Payetools.Common.dll
JSON Converter for instances of DateOnly types.
public class DateOnlyJsonConverter : JsonConverter<DateOnly>
- Inheritance
-
DateOnlyJsonConverter
- Inherited Members
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads an ISO 8601 format date in string format and converts to the appropriate DateOnly value.
public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
reader
Utf8JsonReaderJSON reader (UTF-8 format).
typeToConvert
TypeType to convert (unused).
options
JsonSerializerOptionsJSON serializer options (unused).
Returns
Write(Utf8JsonWriter, DateOnly, JsonSerializerOptions)
Writes a DateOnly value to the JSON stream in ISO 8601 format date in string format.
public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
Parameters
writer
Utf8JsonWriterJSON writer (UTF-8 format).
value
DateOnlyDateOnly value to convert.
options
JsonSerializerOptionsJSON serializer options (unused).