Class PathExpressionRequestEvaluator
Implementation of IEvaluatesPathExpressionRequest which evaluates path expression requests.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.PathExpressions
Assembly: ZptSharp.dll
Syntax
public class PathExpressionRequestEvaluator : IEvaluatesPathExpressionRequest
Remarks
The main work done by this class is the parsing and splitting-up of the path expression into one or more PathExpression.AlternateExpression instances. Each of these is evaluated independently, in order, until either one succeeds in returning a result or until they have thrown an exception.
If an alternate expression returns a result then this is the result of the evaluation operation. If, on the other hand, we exhaust all of the alternate expressions and every one of them raises an exception, this the EvaluateAsync(PathExpressionEvaluationRequest, CancellationToken) method will itself raise an exception.
Constructors
| Improve this Doc View SourcePathExpressionRequestEvaluator(IGetsPathWalkingExpressionEvaluator, IParsesPathExpression)
Initializes a new instance of the PathExpressionRequestEvaluator class.
Declaration
public PathExpressionRequestEvaluator(IGetsPathWalkingExpressionEvaluator walkingEvaluatorFactory, IParsesPathExpression expressionParser)
Parameters
Type | Name | Description |
---|---|---|
IGetsPathWalkingExpressionEvaluator | walkingEvaluatorFactory | Path-walking evaluator. |
IParsesPathExpression | expressionParser | Expression parser. |
Methods
| Improve this Doc View SourceEvaluateAsync(PathExpressionEvaluationRequest, CancellationToken)
Evaluate the expression and return the result.
Declaration
public Task<object> EvaluateAsync(PathExpressionEvaluationRequest request, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
PathExpressionEvaluationRequest | request | Request. |
System.Threading.CancellationToken | token | Token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The async. |