Assembly: OptimaJet.Workflow.Core

Class NewtonsoftDynamicParameterConverter

OptimaJet.Workflow.Core.Model.NewtonsoftDynamicParameterConverter

Provides a JsonConverter that converts DynamicParameter values to and from JSON by using DynamicParameter.SerializeToJson() and DynamicParameter.ParseJson(JToken), respectively.

public class NewtonsoftDynamicParameterConverter : JsonConverter

Type Hierarchy

  • JsonConverter
    • NewtonsoftDynamicParameterConverter Current type

Methods

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) #
Writes the JSON representation returned by DynamicParameter.SerializeToJson().

Parameters

Name
Type
Description
writer
JsonWriter
The JsonWriter that receives the JSON value.
value
Object
The DynamicParameter to serialize. Any other value is written as JSON null.
serializer
JsonSerializer
The JsonSerializer performing the serialization; this converter does not use it.
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) #
Reads a JSON value and converts it through DynamicParameter.ParseJson(JToken).

Parameters

Name
Type
Description
reader
JsonReader
The JsonReader positioned at the value to read.
objectType
Type
The target Type; this converter does not use it.
existingValue
Object
The existing value; this converter does not use it.
serializer
JsonSerializer
The JsonSerializer performing the deserialization; this converter does not use it.

Returns

Type
Description
Object
A scalar or collection value for the corresponding JSON value; a DynamicParameter for a JSON object; or null for a JSON null value.
public override bool CanConvert(Type objectType) #
Determines whether objectType is exactly DynamicParameter.

Parameters

Name
Type
Description
objectType
Type
The Type to evaluate.

Returns

Type
Description
Boolean
true if objectType is exactly DynamicParameter; otherwise, false.