Class Include
- Namespace
- BotManager.Runtime.Expressions
- Assembly
- BotManager.Runtime.dll
Includes and executes an external json config. The included file is only read and parsed once on the first execution.
Returns the value that is returned by the executed file.
{ "$Include": "inc.json" }
[JsonConverter(typeof(IncludeConverter))]
public sealed class Include : IExpression
- Inheritance
-
Include
- Implements
- Inherited Members
Constructors
Include()
Empty constructor for serialization.
public Include()
Include(string)
Creates an expression includes another json file and runs it.
public Include(string fileName)
Parameters
fileNamestringThe filename of the json file to execute.
Properties
FileName
Gets and sets the filename of the json file to execute. The file path can be absolute or relative to the root config file.
[JsonRootProperty]
public string FileName { 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.