Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Remove cancellation token from new System.Data CloseAsync() #39070

Merged
merged 1 commit into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
Expand Down Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,8 @@ public ValueTask<DbTransaction> 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down