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.
This commit is contained in:
Shyju Krishnankutty
2026-03-12 12:48:17 -07:00
Unverified
parent 81705e2c37
commit 5beb0418d3
@@ -31,6 +31,7 @@ internal sealed record AuditEntry(string Step, string Timestamp, string Detail);
/// If the order ID starts with "INVALID", the executor halts the workflow early
/// using <see cref="IWorkflowContext.RequestHaltAsync"/>.
/// </summary>
[YieldsOutput(typeof(string))]
internal sealed class ValidateOrder() : Executor<string, OrderDetails>("ValidateOrder")
{
public override async ValueTask<OrderDetails> HandleAsync(
@@ -73,6 +74,7 @@ internal sealed class ValidateOrder() : Executor<string, OrderDetails>("Validate
/// Uses ReadOrInitStateAsync to lazily initialize a shipping tier.
/// Demonstrates custom scopes by writing shipping details under the "shipping" scope.
/// </summary>
[YieldsOutput(typeof(string))]
internal sealed class EnrichOrder() : Executor<OrderDetails, OrderDetails>("EnrichOrder")
{
public override async ValueTask<OrderDetails> HandleAsync(