Class Call
- Namespace
- BotManager.Runtime.Expressions
- Assembly
- BotManager.Runtime.dll
Calls a registered function and returns it's value. Use Function to register a function beforehand.
Returns the value of the executed function.
{ "$Call": "MyFunction" }
[JsonConverter(typeof(CallConverter))]
public sealed class Call : IExpression
- Inheritance
-
Call
- Implements
- Inherited Members
Constructors
Call()
Empty constructor for serialization.
public Call()
Call(string)
Creates an expression that calls the registered function with the name.
public Call(string name)
Parameters
namestringThe name of the function.
Properties
Name
Gets and sets the name of the function to call.
[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.