Home LogicComponentConverter Class
LogicComponentConverter Class
Cancel

LogicComponentConverter Class

Namespace: Json.Logic

Inheritance: LogicComponentConverter 🡒 JsonConverter<Rule> 🡒 JsonConverter 🡒 object

Provides serialization for all Json.Logic.Rule derivatives.

Properties

NameTypeSummary
HandleNullboolIndicates whether <see langword=”null” /> should be passed to the converter on serialization, and whether System.Text.Json.JsonTokenType.Null should be passed on deserialization.
SaveSourceboolGets or sets whether to save the source data for re-serialization; default is true.
TypeType 

Methods

Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Reads and converts the JSON to type Json.Logic.Rule.

Declaration

1
public override Rule Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
ParameterTypeDescription
readerref Utf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.

Returns

The converted value.

Write(Utf8JsonWriter writer, Rule value, JsonSerializerOptions options)

Writes a specified value as JSON.

Declaration

1
public override void Write(Utf8JsonWriter writer, Rule value, JsonSerializerOptions options)
ParameterTypeDescription
writerUtf8JsonWriterThe writer to write to.
valueRuleThe value to convert to JSON.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.
Contents