diff --git a/src/System.Data.Common/ref/System.Data.Common.cs b/src/System.Data.Common/ref/System.Data.Common.cs index 617af05fdafe..8dc9c80a1f87 100644 --- a/src/System.Data.Common/ref/System.Data.Common.cs +++ b/src/System.Data.Common/ref/System.Data.Common.cs @@ -1916,7 +1916,7 @@ public virtual event System.Data.StateChangeEventHandler StateChange { add { } r public abstract void ChangeDatabase(string databaseName); public virtual System.Threading.Tasks.Task ChangeDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default) { throw null; } public abstract void Close(); - public virtual System.Threading.Tasks.Task CloseAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; } + public virtual System.Threading.Tasks.Task CloseAsync() { throw null; } public System.Data.Common.DbCommand CreateCommand() { throw null; } protected abstract System.Data.Common.DbCommand CreateDbCommand(); public virtual void EnlistTransaction(System.Transactions.Transaction transaction) { } @@ -2062,7 +2062,7 @@ protected DbDataReader() { } public abstract int RecordsAffected { get; } public virtual int VisibleFieldCount { get { throw null; } } public virtual void Close() { } - public virtual System.Threading.Tasks.Task CloseAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; } + public virtual System.Threading.Tasks.Task CloseAsync() { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public void Dispose() { } public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; } diff --git a/src/System.Data.Common/src/System/Data/Common/DbConnection.cs b/src/System.Data.Common/src/System/Data/Common/DbConnection.cs index 531926c473a1..b58290fefe3a 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbConnection.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbConnection.cs @@ -88,13 +88,8 @@ public ValueTask BeginTransactionAsync(IsolationLevel isolationLe public abstract void Close(); - public virtual Task CloseAsync(CancellationToken cancellationToken = default) + public virtual Task CloseAsync() { - if (cancellationToken.IsCancellationRequested) - { - return Task.FromCanceled(cancellationToken); - } - try { Close(); diff --git a/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs b/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs index 80d16f781a9c..9144c2f0061f 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs @@ -32,13 +32,8 @@ protected DbDataReader() : base() { } public virtual void Close() { } - public virtual Task CloseAsync(CancellationToken cancellationToken = default) + public virtual Task CloseAsync() { - if (cancellationToken.IsCancellationRequested) - { - return Task.FromCanceled(cancellationToken); - } - try { Close();