Class JsonDateTimeConverter
Converts DateTime values for System.Text.Json based serialization.
Namespace: Neon.JsonConverters
Assembly: Neon.JsonConverters.dll
Syntax
public class JsonDateTimeConverter : JsonConverter<DateTime>
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type DateTime.
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 |
---|---|
DateTime | 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. |
DateTime | value | The value to convert to JSON. |
JsonSerializerOptions | options | An object that specifies serialization options to use. |