Class Env
- Namespace
- BotManager.Runtime.Expressions
- Assembly
- BotManager.Runtime.dll
Returns the value of a variable from the system environment variables.
Return type is string.
{ "$Env": "MY_VAR" }
[JsonConverter(typeof(EnvConverter))]
public sealed class Env : IExpression
- Inheritance
-
Env
- Implements
- Inherited Members
Constructors
Env()
Empty constructor for serialization.
public Env()
Env(string)
Creates an expression that returns the system environment variable with the given name.
public Env(string name)
Parameters
namestringThe name of the environment variable.
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.