ExpressionEvaluatorContext CreateContext(Expression context, ExpressionEvaluatorParameters parameters) => new ExpressionEvaluatorContext(context, parameters) { Unsupported = Unsupported, NullSubexpression = NullSubexpression };
public EvaluationResult EvaluateAsTarget(Expression expression, Expression context, ExpressionEvaluatorParameters contextParameters) => CreateContext(context, contextParameters).EvaluateAsTarget(expression);
public EvaluationResult Evaluate(Expression body, Expression context, ExpressionEvaluatorParameters parameters) => Evaluate(body, context, parameters, x => { throw new ExceptionExpressionException(x.Expression, context, x.Exception); });
public EvaluationResult Evaluate(Expression body, Expression context, ExpressionEvaluatorParameters parameters, Func<EvaluationResult, EvaluationResult> onError) { var result = CreateContext(context, parameters).Evaluate(body); return result.IsError ? onError(result) : result; }
public ExpressionEvaluatorContext(Expression context, ExpressionEvaluatorParameters parameters) { this.context = context; this.parameters = parameters; }