Table of Contents

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.

This json example set the variable "MyVar" to 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

name string

The variable name.

value IExpression

The value.

Properties

Name

Gets and sets the name of the variable to set.

public string Name { get; set; }

Property Value

string

Value

Gets and sets the value to set.

public IExpression? Value { get; set; }

Property Value

IExpression

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

context RuntimeContext

The current runtime context.

returnType Type

The expected return type. Use typeof(object) for a generic result. Use null if you don't need the return value.

Returns

Task<object>

Returns the result of the expression.