From 9d6b6939c749486a1bf36504dd0ac6c15c6e6dbe Mon Sep 17 00:00:00 2001 From: David Justo Date: Wed, 22 May 2024 16:30:31 -0700 Subject: [PATCH] simplify method resolution of terminate --- src/Client/Core/DurableTaskClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client/Core/DurableTaskClient.cs b/src/Client/Core/DurableTaskClient.cs index 449afb3a..1995c06a 100644 --- a/src/Client/Core/DurableTaskClient.cs +++ b/src/Client/Core/DurableTaskClient.cs @@ -216,7 +216,7 @@ public virtual Task TerminateInstanceAsync(string instanceId, CancellationToken /// public virtual Task TerminateInstanceAsync(string instanceId, object? output = null, CancellationToken cancellation = default) { - TerminateInstanceOptions? options = output is null ? null : new() { Output = output }; + TerminateInstanceOptions? options = new() { Output = output }; return this.TerminateInstanceAsync(instanceId, options, cancellation); } @@ -252,7 +252,7 @@ public virtual Task TerminateInstanceAsync(string instanceId, object? output = n /// termination of the orchestration once enqueued. /// /// A task that completes when the terminate message is enqueued. - public virtual Task TerminateInstanceAsync(string instanceId, TerminateInstanceOptions? options = null, CancellationToken cancellation = default) + public virtual Task TerminateInstanceAsync(string instanceId, TerminateInstanceOptions options, CancellationToken cancellation = default) => throw new NotSupportedException($"{this.GetType()} does not support orchestration termination."); ///