Class CSharpExpressionEvaluator
An implementation of IEvaluatesExpression which evaluates TALES 'csharp' expressions.
Inheritance
System.Object
CSharpExpressionEvaluator
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Expressions.CSharpExpressions
Assembly: ZptSharp.CSharpExpressions.dll
Syntax
public class CSharpExpressionEvaluator : IEvaluatesExpression
Constructors
| Improve this Doc View SourceCSharpExpressionEvaluator(IGetsAllVariablesFromContext, ICachesCSharpExpressions, ICreatesCSharpExpressions, IGetsExpressionDescription, IConfiguresCSharpExpressionGlobals)
Initializes a new instance of CSharpExpressionEvaluator,
Declaration
public CSharpExpressionEvaluator(IGetsAllVariablesFromContext allValuesProvider, ICachesCSharpExpressions expressionCache, ICreatesCSharpExpressions expressionFactory, IGetsExpressionDescription identityFactory, IConfiguresCSharpExpressionGlobals globalConfig)
Parameters
Type | Name | Description |
---|---|---|
IGetsAllVariablesFromContext | allValuesProvider | A provider for all in-scope values in an expression context. |
ICachesCSharpExpressions | expressionCache | A cache for compiled C# expressions. |
ICreatesCSharpExpressions | expressionFactory | A factory for compiling new C# expressions. |
IGetsExpressionDescription | identityFactory | A factory for expression identity objects. |
IConfiguresCSharpExpressionGlobals | globalConfig | Global configuration for C# expressions. |
Methods
| Improve this Doc View SourceEvaluateExpressionAsync(String, ExpressionContext, CancellationToken)
Evaluates the expression asynchronously and returns the result.
Declaration
public Task<object> EvaluateExpressionAsync(string expression, ExpressionContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | The expression string. |
ExpressionContext | context | The expression context. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The expression result. |