< Summary

Information
Class: Elsa.Extensions.StoredTriggerExtensions
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/StoredTriggerExtensions.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 18
Line coverage: 100%
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
GetPayload(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/StoredTriggerExtensions.cs

#LineLine coverage
 1using Elsa.Workflows.Runtime.Entities;
 2
 3// ReSharper disable once CheckNamespace
 4namespace Elsa.Extensions;
 5
 6/// <summary>
 7/// Adds extensions to <see cref="StoredTrigger"/>.
 8/// </summary>
 9public static class StoredTriggerExtensions
 10{
 11    /// <summary>
 12    /// Returns the Data property of the stored trigger as a strongly-typed object.
 13    /// </summary>
 14    /// <param name="storedTrigger">The stored trigger.</param>
 15    /// <typeparam name="T">The type of the Data property.</typeparam>
 16    /// <returns>The Data property of the stored trigger as a strongly-typed object.</returns>
 27517    public static T GetPayload<T>(this StoredTrigger storedTrigger) => (T)storedTrigger.Payload!;
 18}