Class JsonNullableDateTimeConverter
Converts Nullable<T> values for System.Text.Json based serialization.
Namespace: Neon.JsonConverters
Assembly: Neon.JsonConverters.dll
Syntax
public class JsonNullableDateTimeConverter : JsonConverter<DateTime?>
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type Nullable.
Declaration
public override DateTime? Read(ref Utf8JsonReader reader, Type type, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonReader | reader | The reader. |
Type | type | |
JsonSerializerOptions | options | An object that specifies serialization options to use. |
Returns
Type | Description |
---|---|
Nullable | The converted value. |
Overrides
Write(Utf8JsonWriter, DateTime?, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | The writer to write to. |
Nullable | value | The value to convert to JSON. |
JsonSerializerOptions | options | An object that specifies serialization options to use. |