Class PipeExpressionEvaluator
An implementation of IEvaluatesExpression which evaluates TALES 'pipe' expressions.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.PipeExpressions
Assembly: ZptSharp.dll
Syntax
public class PipeExpressionEvaluator : IEvaluatesExpression
Remarks
A pipe expression is essentially an invocation of a System.Func<T, TResult> upon an existing variable. The function delegate's result/output type is always System.Object, although the input parameter may vary in type.
The result of the expression is the output of the function delegate, when executed against the specified variable. Pipe expressions are most useful for transforming or formatting values for output.
Constructors
| Improve this Doc View SourcePipeExpressionEvaluator(IEvaluatesExpression, IEvaluatesPipeDelegate)
Initializes a new instance of PipeExpressionEvaluator.
Declaration
public PipeExpressionEvaluator(IEvaluatesExpression evaluator, IEvaluatesPipeDelegate delegateEvaluator)
Parameters
Type | Name | Description |
---|---|---|
IEvaluatesExpression | evaluator | An expression evaluator. |
IEvaluatesPipeDelegate | delegateEvaluator | A delegate evaluator. |
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. |