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.
{ "$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
namestringThe variable name.
Properties
Name
Gets and sets the name of the variable.
[JsonRootProperty]
public string Name { 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.