Exemplo n.º 1
0
            public Task <EvaluationResult> Evaluate(CancellationToken cancellationToken)
            {
                // wrap the AST task so that instead of returning only one boolean, it returns also the error message
                return(new Task <EvaluationResult>(() =>
                {
                    var astTask = _ast.Evaluate(cancellationToken);
                    astTask.Start();

                    return new EvaluationResult
                    {
                        RuleId = _ruleId,
                        ConcernedProperties = _concernedProperties,
                        AstResult = astTask.Result,
                        ErrorMessage = _errorMessage
                    };
                }, cancellationToken));
            }