| | | 1 | | using Elsa.Expressions.Contracts; |
| | | 2 | | using Elsa.Expressions.Models; |
| | | 3 | | using Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | // ReSharper disable once CheckNamespace |
| | | 6 | | namespace Elsa.Extensions; |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Contains extension methods for <see cref="IExpressionEvaluator"/>. |
| | | 10 | | /// </summary> |
| | | 11 | | public static class ExpressionEvaluatorExtensions |
| | | 12 | | { |
| | | 13 | | extension(IExpressionEvaluator evaluator) |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Evaluates the specified expression and returns the result. |
| | | 17 | | /// </summary> |
| | | 18 | | public ValueTask<T?> EvaluateAsync<T>(Input<T> input, ExpressionExecutionContext context, ExpressionEvaluatorOpt |
| | | 19 | | { |
| | 3 | 20 | | return evaluator.EvaluateAsync<T>(input.Expression!, context, options); |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Evaluates the specified expression and returns the result. |
| | | 25 | | /// </summary> |
| | | 26 | | public ValueTask<object?> EvaluateAsync(Input input, ExpressionExecutionContext context, ExpressionEvaluatorOpti |
| | | 27 | | { |
| | 2710 | 28 | | return evaluator.EvaluateAsync(input.Expression!, input.Type, context, options); |
| | | 29 | | } |
| | | 30 | | } |
| | | 31 | | } |