Class Function
- Namespace
- BotManager.Runtime.Expressions
- Assembly
- BotManager.Runtime.dll
Registers a new function in the runtime context. Use Call to execute it later.
Return type is null.
{ "$Function": { "Name": "MyFunction", "Action": 10 } }
public sealed class Function : IExpression
- Inheritance
-
Function
- Implements
- Inherited Members
Constructors
Function()
public Function()
Properties
Action
Gets and sets the expression that is executed when the stored function is called.
public IExpression? Action { get; set; }
Property Value
Name
Gets and sets the name of the function.
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.