Table of Contents

Class Get

Namespace
BotManager.Runtime.Expressions
Assembly
BotManager.Runtime.dll

Returns the value of a variable from the current RuntimeContext.

Return type is the type of the variable.

This json example returns the value of the "MyVar" variable:
{ "$Get": "MyVar" }
[JsonConverter(typeof(GetConverter))]
public sealed class Get : IExpression
Inheritance
Get
Implements
Inherited Members

Constructors

Get()

Empty constructor for serialization.

public Get()

Get(string)

Creates an expression that returns a variable from the current RuntimeContext.

public Get(string name)

Parameters

name string

The variable name.

Properties

Name

Gets and sets the name of the variable.

[JsonRootProperty]
public string Name { get; set; }

Property Value

string

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.