Table of Contents

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.

This json example executes the user-defined function "MyFunction" and returns its value:
{ "$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

name string

The name of the function.

Properties

Name

Gets and sets the name of the function to call.

[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.