< Summary - AsyncResponse (Release / net8.0+net10.0 / unit+integration)

Information
Class: AsyncResponse.DurableFlowRegistration
Assembly: AsyncResponse.Core
File(s): /_/src/AsyncResponse.Core/DurableFlowRegistration.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 32
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
get_FlowTypeFullName()100%11100%
get_InputTypeFullName()100%11100%
get_FlowType()100%11100%
get_DeserializeInput()100%11100%
get_ExecuteAsync()100%11100%

File(s)

/_/src/AsyncResponse.Core/DurableFlowRegistration.cs

#LineLine coverage
 1namespace AsyncResponse;
 2
 3/// <summary>
 4/// A statically-typed durable-flow registration produced by
 5/// <c>WithDurableFlow&lt;TFlow, TInput&gt;()</c>. The executor prefers it over the reflection path
 6/// when re-hydrating a run from its persisted <see cref="FlowState.FlowTypeName"/>: the flow
 7/// resolves, its input deserializes through typed JSON metadata, and <c>ExecuteAsync</c> is a
 8/// direct delegate call — no type-name scans, no <c>MakeGenericType</c>, no
 9/// <c>MethodInfo.Invoke</c> — which is what lets registered flows run under trimming/Native AOT.
 10/// Unregistered flows keep the historical reflection-based resolution.
 11/// </summary>
 12internal sealed class DurableFlowRegistration
 13{
 14    /// <summary>The flow class full name as persisted in <see cref="FlowState.FlowTypeName"/>.</summary>
 377515    public required string FlowTypeFullName { get; init; }
 16
 17    /// <summary>
 18    /// The TInput full name, formatted exactly as <see cref="FlowState.InputTypeName"/> is stamped
 19    /// at start (<c>typeof(TInput).FullName</c>), so the executor can reject a persisted run whose
 20    /// input type no longer matches this registration instead of silently deserializing it.
 21    /// </summary>
 404722    public required string InputTypeFullName { get; init; }
 23
 24    /// <summary>The flow class, resolved from DI per execution.</summary>
 404525    public required Type FlowType { get; init; }
 26
 27    /// <summary>Deserializes the persisted input JSON as the flow's TInput.</summary>
 404528    public required Func<string, object?> DeserializeInput { get; init; }
 29
 30    /// <summary>Invokes <c>((TFlow)flow).ExecuteAsync(context, (TInput)input)</c> statically.</summary>
 404731    public required Func<object, IDurableFlowContext, object?, Task> ExecuteAsync { get; init; }
 32}