Class Set
- Namespace
- BotManager.Runtime.Expressions
- Assembly
- BotManager.Runtime.dll
Sets a variable in the current RuntimeContext.
Returns type is the type of the variable.
10 and returns this value:
{ "$Set": { "Name": "MyVar", "Value": 10 } }
public sealed class Set : IExpression
- Inheritance
-
Set
- Implements
- Inherited Members
Constructors
Set()
Empty constructor for serialization.
public Set()
Set(string, IExpression?)
Creates an expression that sets a variable to the given value.
public Set(string name, IExpression? value)
Parameters
namestringThe variable name.
valueIExpressionThe value.
Properties
Name
Gets and sets the name of the variable to set.
public string Name { get; set; }
Property Value
Value
Gets and sets the value to set.
public IExpression? Value { get; set; }
Property Value
Methods
ExecuteAsync(RuntimeContext, Type?)
Executes the expression in the given RuntimeContext. Please do not use this method to run an expression. Use ExecuteAsync(IExpression?) instead.
public Task<object?> ExecuteAsync(RuntimeContext context, Type? returnType)
Parameters
contextRuntimeContextThe current runtime context.
returnTypeTypeThe expected return type. Use
typeof(object)for a generic result. Usenullif you don't need the return value.