Skip to content

Commit 5beb041

Browse files
committed
Add YieldsOutput(string) to workflow shared state sample executors
ValidateOrder and EnrichOrder call YieldOutputAsync with string messages, but only their TOutput (OrderDetails) was in the allowed yield types. This caused TargetInvocationException in the WorkflowSharedState sample validation integration test.
1 parent 81705e2 commit 5beb041

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/06_WorkflowSharedState

dotnet/samples/04-hosting/DurableWorkflows/ConsoleApps/06_WorkflowSharedState/Executors.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ internal sealed record AuditEntry(string Step, string Timestamp, string Detail);
3131
/// If the order ID starts with "INVALID", the executor halts the workflow early
3232
/// using <see cref="IWorkflowContext.RequestHaltAsync"/>.
3333
/// </summary>
34+
[YieldsOutput(typeof(string))]
3435
internal sealed class ValidateOrder() : Executor<string, OrderDetails>("ValidateOrder")
3536
{
3637
public override async ValueTask<OrderDetails> HandleAsync(
@@ -73,6 +74,7 @@ public override async ValueTask<OrderDetails> HandleAsync(
7374
/// Uses ReadOrInitStateAsync to lazily initialize a shipping tier.
7475
/// Demonstrates custom scopes by writing shipping details under the "shipping" scope.
7576
/// </summary>
77+
[YieldsOutput(typeof(string))]
7678
internal sealed class EnrichOrder() : Executor<OrderDetails, OrderDetails>("EnrichOrder")
7779
{
7880
public override async ValueTask<OrderDetails> HandleAsync(

0 commit comments

Comments
 (0)