Table of Contents

Class JsonStringConverter<T>

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

JSON converter that stores a value of type T as a raw JSON string (i.e., the object is serialized to JSON and that JSON is stored as a string value, and vice versa).

public class JsonStringConverter<T> : JsonConverter<T>

Type Parameters

T
Inheritance
JsonStringConverter<T>
Inherited Members

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts a JSON string to a T instance by deserializing the string's contents.

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

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

T

Write(Utf8JsonWriter, T, JsonSerializerOptions)

Writes a T value as a JSON string by serializing it to a JSON string value.

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

Parameters

writer Utf8JsonWriter
value T
options JsonSerializerOptions