Class JsonStringConverter<T>
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
readerUtf8JsonReadertypeToConvertTypeoptionsJsonSerializerOptions
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
writerUtf8JsonWritervalueToptionsJsonSerializerOptions