Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Class DynamicParameter

OptimaJet.Workflow.Core.Model.DynamicParameter

Dynamic parameter, properties can be accessed two ways de["propertyName"] or (de as dynamic).propertyName Property names are case sensitive

[JsonConverter(typeof(NewtonsoftDynamicParameterConverter))]
[JsonConverter(typeof(SystemTextDynamicParameterConverter))]
public sealed class DynamicParameter : DynamicObject, IDynamicMetaObjectProvider

Inheritance

  • System.Object
  • System.Dynamic.DynamicObject

Implemented Interfaces

  • System.Dynamic.IDynamicMetaObjectProvider

Attributes

  • Newtonsoft.Json.JsonConverterAttribute: Attribute of type Newtonsoft.Json.JsonConverterAttribute
  • System.Text.Json.Serialization.JsonConverterAttribute: Attribute of type System.Text.Json.Serialization.JsonConverterAttribute

Constructors

public DynamicParameter() #
Creates empty dynamic parameter object
public DynamicParameter(Dictionary<string, object> properties) #
Creates initialized dynamic parameter object

Parameters

Name
Type
Description
properties
Dictionary<Object>

Properties

Name
Type
Dictionary #
IReadOnlyDictionary<Object>
Returns dictionary with all properties
this[string] #
Object
Indexer for getting property value

Methods

public override bool TryGetMember(GetMemberBinder binder, out object result) #

Parameters

Name
Type
Description
binder
GetMemberBinder
result
Object

Returns

Type
Description
Boolean
public override bool TrySetMember(SetMemberBinder binder, object value) #

Parameters

Name
Type
Description
binder
SetMemberBinder
value
Object

Returns

Type
Description
Boolean
public object GetProperty(string propertyName) #
Returns property value

Parameters

Name
Type
Description
propertyName
String
Property name

Returns

Type
Description
Object
Property value
public void SetProperty(string propertyName, object value) #
Sets property value

Parameters

Name
Type
Description
propertyName
String
Property name
value
Object
Property value
public bool HasProperty(string propertyName, bool ifNullThenNotExists = false) #
Checks either property exists in the dynamic parameter object or not.

Parameters

Name
Type
Description
propertyName
String
Property name
ifNullThenNotExists
Boolean

Returns

Type
Description
Boolean
true if property exists in the dynamic parameter object.
public DynamicParameter DeepClone() #
Creates a deep copy of the dynamic parameter object

Returns

Type
Description
DynamicParameter
Deep copy of the dynamic parameter object
public string SerializeToJson() #
Serializes the dynamic parameter object to JSON

Returns

Type
Description
String
JSON string
public static object ParseJson(string json) #
Deserializes JSON the result can be casted as dynamic. The result can be simple value (string, int, double etc) or instance of DynamicParameter class

Parameters

Name
Type
Description
json
String
JSON string

Returns

Type
Description
Object
Dynamic parameter object
public static object ParseJson(JToken jToken) #
Deserializes JSON the result can be casted as dynamic. The result can be simple value (string, int, double etc) or instance of DynamicParameter class

Parameters

Name
Type
Description
jToken
JToken
Newtonsoft.JSON JToken object

Returns

Type
Description
Object
Dynamic parameter object
public static dynamic New() #
Creates new DynamicParameter instance

Returns

Type
Description
dynamic
public static object ConvertFrom(object value) #
Converts from any object to dynamic object

Parameters

Name
Type
Description
value
Object

Returns

Type
Description
Object
public T ConvertTo<T>() where T : IDynamicParameterCompatible, new() #
Converts from a dynamic parameter to any object that implements IDynamicParameterCompatible

Returns

Type
Description
{T}
Instance of T
public T Restore<T>() #

Returns

Type
Description
{T}
public object Restore(Type originalType) #

Parameters

Name
Type
Description
originalType
Type

Returns

Type
Description
Object