Table of Contents

Class DurationConverter

Namespace
DataStax.AstraDB.DataApi.SerDes
Assembly
DataStax.AstraDB.DataApi.dll

JSON converter for the Duration type, converting between the CQL duration string representation and JSON string values.

public class DurationConverter : JsonConverter<Duration>
Inheritance
DurationConverter
Inherited Members

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts a JSON string to a Duration value.

public override Duration Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

Duration

Write(Utf8JsonWriter, Duration, JsonSerializerOptions)

Writes a Duration value as a JSON string.

public override void Write(Utf8JsonWriter writer, Duration value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value Duration
options JsonSerializerOptions