< Summary

Information
Class: Elsa.Expressions.CSharp.Models.OutputProxy
Assembly: Elsa.Expressions.CSharp
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/Models/OutputProxy.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 60
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
.ctor(...)100%210%
From(...)100%210%
From(...)100%210%
Get(...)100%210%
Get(...)100%210%
get_LastResult()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.CSharp/Models/OutputProxy.cs

#LineLine coverage
 1using Elsa.Expressions.Helpers;
 2using Elsa.Expressions.Models;
 3using Elsa.Extensions;
 4
 5namespace Elsa.Expressions.CSharp.Models;
 6
 7/// <summary>
 8/// Provides access to activity outputs.
 9/// </summary>
 10public class OutputProxy
 11{
 12    private readonly ExpressionExecutionContext _expressionExecutionContext;
 13
 14    /// <summary>
 15    /// Initializes a new instance of the <see cref="OutputProxy"/> class.
 16    /// </summary>
 017    public OutputProxy(ExpressionExecutionContext expressionExecutionContext)
 18    {
 019        _expressionExecutionContext = expressionExecutionContext;
 020    }
 21
 22    /// <summary>
 23    /// Gets the value of the specified output from the specified activity.
 24    /// </summary>
 25    /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param>
 26    /// <param name="outputName">The name of the output.</param>
 27    /// <returns>The value of the output.</returns>
 028    public object? From(string activityIdOrName, string? outputName = null) => _expressionExecutionContext.GetOutput(act
 29
 30    /// <summary>
 31    /// Gets the value of the specified output from the specified activity.
 32    /// </summary>
 33    /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param>
 34    /// <param name="outputName">The name of the output.</param>
 35    /// <returns>The value of the output.</returns>
 036    public T? From<T>(string activityIdOrName, string? outputName = null) => From(activityIdOrName, outputName).ConvertT
 37
 38    /// <summary>
 39    /// Gets the value of the specified output.
 40    /// </summary>
 41    /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param>
 42    /// <param name="outputName">The name of the output.</param>
 43    /// <returns>The value of the output.</returns>
 44    [Obsolete("Use From instead.")]
 045    public object? Get(string activityIdOrName, string? outputName = null) => From(activityIdOrName, outputName);
 46
 47    /// <summary>
 48    /// Gets the value of the specified output.
 49    /// </summary>
 50    /// <param name="activityIdOrName">The ID or name of the activity that produced the output.</param>
 51    /// <param name="outputName">The name of the output.</param>
 52    /// <returns>The value of the output.</returns>
 53    [Obsolete("Use From instead.")]
 054    public T? Get<T>(string activityIdOrName, string? outputName = null) => From<T>(activityIdOrName, outputName);
 55
 56    /// <summary>
 57    /// Gets the result of the last activity that executed.
 58    /// </summary>
 059    public object? LastResult => _expressionExecutionContext.GetLastResult();
 60}