public async Task OperateAsync(ComplexTypeWithCancellationToken complexType) { Cancellation = complexType.CancellationToken; using (Cancellation.Register(() => TaskCompletionSource.TrySetCanceled(Cancellation))) { await(TaskCompletionSource?.Task ?? Task.CompletedTask); } }