Skip to content

GrainIdJsonConverter Methods

Functionality for converting a GrainId to and from a JSON string.

Read(Utf8JsonReader, Type, JsonSerializerOptions)

override
View source
public override GrainId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads and converts the JSON to type T.

Parameters

readerUtf8JsonReader
The reader.
typeToConvertType
The type to convert.
optionsJsonSerializerOptions
An object that specifies serialization options to use.

Returns

The converted value.

ReadAsPropertyName(Utf8JsonReader, Type, JsonSerializerOptions)

override
View source
public override GrainId ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads a dictionary key from a JSON property name.

Parameters

readerUtf8JsonReader
The System.Text.Json.Utf8JsonReader to read from.
typeToConvertType
The type to convert.
optionsJsonSerializerOptions
The options to use when reading the value.

Returns

The value that was converted.

Write(Utf8JsonWriter, GrainId, JsonSerializerOptions)

override
View source
public override void Write(Utf8JsonWriter writer, GrainId value, JsonSerializerOptions options)
Writes a specified value as JSON.

Parameters

writerUtf8JsonWriter
The writer to write to.
valueGrainId
The value to convert to JSON.
optionsJsonSerializerOptions
An object that specifies serialization options to use.

WriteAsPropertyName(Utf8JsonWriter, GrainId, JsonSerializerOptions)

override
View source
public override void WriteAsPropertyName(Utf8JsonWriter writer, GrainId value, JsonSerializerOptions options)
Writes a dictionary key as a JSON property name.

Parameters

writerUtf8JsonWriter
The System.Text.Json.Utf8JsonWriter to write to.
valueGrainId
The value to convert. The value of System.Text.Json.Serialization.JsonConverter.HandleNull determines if the converter handles null values.
optionsJsonSerializerOptions
The options to use when writing the value.