< Summary

Information
Class: Elsa.Expressions.CSharp.Extensions.CSharpEvaluatorExtensions
Assembly: Elsa.Expressions.CSharp
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/Extensions/CSharpEvaluatorExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 30
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
EvaluateAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/Extensions/CSharpEvaluatorExtensions.cs

#LineLine coverage
 1using Elsa.Expressions.CSharp.Contracts;
 2using Elsa.Expressions.Models;
 3
 4namespace Elsa.Expressions.CSharp.Extensions;
 5
 6/// <summary>
 7/// Provides extension methods for <see cref="ICSharpEvaluator"/>.
 8/// </summary>
 9public static class CSharpEvaluatorExtensions
 10{
 11    /// <summary>
 12    /// Evaluates a C# expression.
 13    /// </summary>
 14    /// <param name="evaluator">The evaluator.</param>
 15    /// <param name="expression">The expression to evaluate.</param>
 16    /// <param name="returnType">The type of the return value.</param>
 17    /// <param name="context">The context in which the expression is evaluated.</param>
 18    /// <param name="options">An set of options.</param>
 19    /// <param name="cancellationToken">An optional cancellation token.</param>
 20    /// <returns>The result of the evaluation.</returns>
 21    public static async Task<object?> EvaluateAsync(this ICSharpEvaluator evaluator,
 22        string expression,
 23        Type returnType,
 24        ExpressionExecutionContext context,
 25        ExpressionEvaluatorOptions options,
 26        CancellationToken cancellationToken = default)
 27    {
 028        return await evaluator.EvaluateAsync(expression, returnType, context, options, null, null, cancellationToken);
 029    }
 30}

Methods/Properties

EvaluateAsync()