Class RippleDateTimeConverter
Ripple datetime converter
Inheritance
object
JsonConverter
JsonConverter<DateTime?>
RippleDateTimeConverter
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public class RippleDateTimeConverter : JsonConverter<DateTime?>
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
read System.DateTime from json object
Declaration
public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | json reader |
| Type | typeToConvert | target type |
| JsonSerializerOptions | options | json serializer options |
Returns
| Type | Description |
|---|---|
| Nullable | System.DateTime |
Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTime?>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
Exceptions
| Type | Condition |
|---|---|
| JsonException | Invalid double value. or Invalid token. Expected string |
Write(Utf8JsonWriter, DateTime?, JsonSerializerOptions)
write System.DateTime to json object
Declaration
public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | writer |
| Nullable | value | System.DateTime value |
| JsonSerializerOptions | options | json serializer options |
Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTime?>.Write(System.Text.Json.Utf8JsonWriter, System.DateTime?, System.Text.Json.JsonSerializerOptions)
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | value provided is not a DateTime |