diff --git a/src/Temporalio/Client/ITemporalClientExtensions.cs b/src/Temporalio/Client/ITemporalClientExtensions.cs index 2beb2d26..b1c6a91e 100644 --- a/src/Temporalio/Client/ITemporalClientExtensions.cs +++ b/src/Temporalio/Client/ITemporalClientExtensions.cs @@ -43,6 +43,49 @@ public static async Task ExecuteWorkflowAsync( return await handle.GetResultAsync(rpcOptions: options.Rpc).ConfigureAwait(false); } + /// + /// Signal and (optionally) start a workflow via lambda invoking the signalWithStart method. + /// + /// Workflow class type. + /// Client to use. + /// Invocation of workflow run method with a result. + /// Invocation of signal method without a result. + /// Start workflow options. ID and TaskQueue are required. + /// Workflow handle for the started workflow. + /// Invalid run call or options. + /// Server-side error. + public static async Task> SignalWorkflowWithStartAsync( + this ITemporalClient client, + Expression> workflowRunCall, + Expression> signalCall, + WorkflowOptions options) + { + options.SignalWithStart(signalCall); + return await client.StartWorkflowAsync(workflowRunCall, options).ConfigureAwait(false); + } + + /// + /// Signal and (optionally) start a workflow via lambda invoking the signalWithStart method. + /// + /// Workflow class type. + /// Workflow result type. + /// Client to use. + /// Invocation of workflow run method with a result. + /// Invocation of signal method without a result. + /// Start workflow options. ID and TaskQueue are required. + /// Workflow handle for the started workflow. + /// Invalid run call or options. + /// Server-side error. + public static async Task> SignalWorkflowWithStartAsync( + this ITemporalClient client, + Expression>> workflowRunCall, + Expression> signalCall, + WorkflowOptions options) + { + options.SignalWithStart(signalCall); + return await client.StartWorkflowAsync(workflowRunCall, options).ConfigureAwait(false); + } + /// /// Shortcut for /// @@ -158,4 +201,4 @@ public static async IAsyncEnumerable ListWorkflowHistoriesAsync } #endif } -} \ No newline at end of file +}