Class JsonEpochSecondsDateTimeOffsetConverter
The JsonDateTimeOffset
to/from JSON number using epoch seconds.
Inheritance
System.Object
System.Text.Json.Serialization.JsonConverter
System.Text.Json.Serialization.JsonConverter <System.DateTimeOffset >
JsonEpochSecondsDateTimeOffsetConverter
Namespace: LambdaSharp.Serialization
Assembly: LambdaSharp.dll
Syntax
public class JsonEpochSecondsDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts JSON to the appropriate type.
Declaration
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
System. |
reader | The reader. |
System. |
typeToConvert | The type to convert. |
System. |
options | An object that specifies serialization options to use. |
Returns
Type | Description |
---|---|
System. |
Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTimeOffset>.Read(System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
Write(Utf8JsonWriter, DateTimeOffset, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
System. |
writer | The writer to write to. |
System. |
value | The value to convert to JSON. |
System. |
options | An object that specifies serialization options to use. |
Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTimeOffset>.Write(System.Text.Json.Utf8JsonWriter, System.DateTimeOffset, System.Text.Json.JsonSerializerOptions)