Skip to content

Commit

Permalink
simplify method resolution of terminate
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid committed May 22, 2024
1 parent 76a2972 commit 9d6b693
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client/Core/DurableTaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public virtual Task TerminateInstanceAsync(string instanceId, CancellationToken
/// <inheritdoc cref="TerminateInstanceAsync(string, TerminateInstanceOptions, 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);
}

Expand Down Expand Up @@ -252,7 +252,7 @@ public virtual Task TerminateInstanceAsync(string instanceId, object? output = n
/// termination of the orchestration once enqueued.
/// </param>
/// <returns>A task that completes when the terminate message is enqueued.</returns>
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.");

/// <inheritdoc cref="SuspendInstanceAsync(string, string, CancellationToken)"/>
Expand Down

0 comments on commit 9d6b693

Please sign in to comment.