Skip to content

Commit 974d564

Browse files
committed
Add async methods in System.Data.Common, implement IAsyncDisposable
See https://github.com/dotnet/corefx/issues/35012
1 parent 9433587 commit 974d564

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/netstandard/ref/System.Data.Common.cs

+17-4
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected DbColumn() { }
208208
public System.Nullable<int> NumericScale { get { throw null; } protected set { } }
209209
public string UdtAssemblyQualifiedName { get { throw null; } protected set { } }
210210
}
211-
public abstract partial class DbCommand : System.ComponentModel.Component, System.Data.IDbCommand, System.IDisposable
211+
public abstract partial class DbCommand : System.ComponentModel.Component, System.Data.IDbCommand, System.IDisposable, System.IAsyncDisposable
212212
{
213213
protected DbCommand() { }
214214
[System.ComponentModel.DefaultValueAttribute("")]
@@ -260,9 +260,11 @@ protected DbCommand() { }
260260
public System.Threading.Tasks.Task<object> ExecuteScalarAsync() { throw null; }
261261
public virtual System.Threading.Tasks.Task<object> ExecuteScalarAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
262262
public abstract void Prepare();
263+
public virtual System.Threading.Tasks.Task PrepareAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
263264
System.Data.IDbDataParameter System.Data.IDbCommand.CreateParameter() { throw null; }
264265
System.Data.IDataReader System.Data.IDbCommand.ExecuteReader() { throw null; }
265266
System.Data.IDataReader System.Data.IDbCommand.ExecuteReader(System.Data.CommandBehavior behavior) { throw null; }
267+
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
266268
}
267269
public abstract partial class DbCommandBuilder : System.ComponentModel.Component
268270
{
@@ -303,7 +305,7 @@ protected void RowUpdatingHandler(System.Data.Common.RowUpdatingEventArgs rowUpd
303305
protected abstract void SetRowUpdatingHandler(System.Data.Common.DbDataAdapter adapter);
304306
public virtual string UnquoteIdentifier(string quotedIdentifier) { throw null; }
305307
}
306-
public abstract partial class DbConnection : System.ComponentModel.Component, System.Data.IDbConnection, System.IDisposable
308+
public abstract partial class DbConnection : System.ComponentModel.Component, System.Data.IDbConnection, System.IDisposable, System.IAsyncDisposable
307309
{
308310
protected DbConnection() { }
309311
[System.ComponentModel.DefaultValueAttribute("")]
@@ -324,7 +326,9 @@ public virtual event System.Data.StateChangeEventHandler StateChange { add { } r
324326
public System.Data.Common.DbTransaction BeginTransaction() { throw null; }
325327
public System.Data.Common.DbTransaction BeginTransaction(System.Data.IsolationLevel isolationLevel) { throw null; }
326328
public abstract void ChangeDatabase(string databaseName);
329+
public virtual System.Threading.Tasks.Task ChangeDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default) { throw null; }
327330
public abstract void Close();
331+
public virtual System.Threading.Tasks.Task CloseAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
328332
public System.Data.Common.DbCommand CreateCommand() { throw null; }
329333
protected abstract System.Data.Common.DbCommand CreateDbCommand();
330334
public virtual void EnlistTransaction(System.Transactions.Transaction transaction) { }
@@ -337,7 +341,11 @@ protected virtual void OnStateChange(System.Data.StateChangeEventArgs stateChang
337341
public virtual System.Threading.Tasks.Task OpenAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
338342
System.Data.IDbTransaction System.Data.IDbConnection.BeginTransaction() { throw null; }
339343
System.Data.IDbTransaction System.Data.IDbConnection.BeginTransaction(System.Data.IsolationLevel isolationLevel) { throw null; }
344+
protected virtual System.Threading.Tasks.ValueTask<DbTransaction> BeginDbTransactionAsync(IsolationLevel isolationLevel, System.Threading.CancellationToken cancellationToken) { throw null; }
345+
public System.Threading.Tasks.ValueTask<DbTransaction> BeginTransactionAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
346+
public System.Threading.Tasks.ValueTask<DbTransaction> BeginTransactionAsync(IsolationLevel isolationLevel, System.Threading.CancellationToken cancellationToken = default) { throw null; }
340347
System.Data.IDbCommand System.Data.IDbConnection.CreateCommand() { throw null; }
348+
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
341349
}
342350
public partial class DbConnectionStringBuilder : System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable, System.ComponentModel.ICustomTypeDescriptor
343351
{
@@ -454,7 +462,7 @@ protected virtual void TerminateBatching() { }
454462
public int Update(System.Data.DataSet dataSet, string srcTable) { throw null; }
455463
public int Update(System.Data.DataTable dataTable) { throw null; }
456464
}
457-
public abstract partial class DbDataReader : System.MarshalByRefObject, System.Collections.IEnumerable, System.Data.IDataReader, System.Data.IDataRecord, System.IDisposable
465+
public abstract partial class DbDataReader : System.MarshalByRefObject, System.Collections.IEnumerable, System.Data.IDataReader, System.Data.IDataRecord, System.IDisposable, System.IAsyncDisposable
458466
{
459467
protected DbDataReader() { }
460468
public abstract int Depth { get; }
@@ -466,9 +474,11 @@ protected DbDataReader() { }
466474
public abstract int RecordsAffected { get; }
467475
public virtual int VisibleFieldCount { get { throw null; } }
468476
public virtual void Close() { }
477+
public virtual System.Threading.Tasks.Task CloseAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
469478
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
470479
public void Dispose() { }
471480
protected virtual void Dispose(bool disposing) { }
481+
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
472482
public abstract bool GetBoolean(int ordinal);
473483
public abstract byte GetByte(int ordinal);
474484
public abstract long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length);
@@ -754,17 +764,20 @@ public sealed partial class DbProviderSpecificTypePropertyAttribute : System.Att
754764
public DbProviderSpecificTypePropertyAttribute(bool isProviderSpecificTypeProperty) { }
755765
public bool IsProviderSpecificTypeProperty { get { throw null; } }
756766
}
757-
public abstract partial class DbTransaction : System.MarshalByRefObject, System.Data.IDbTransaction, System.IDisposable
767+
public abstract partial class DbTransaction : System.MarshalByRefObject, System.Data.IDbTransaction, System.IDisposable, System.IAsyncDisposable
758768
{
759769
protected DbTransaction() { }
760770
public System.Data.Common.DbConnection Connection { get { throw null; } }
761771
protected abstract System.Data.Common.DbConnection DbConnection { get; }
762772
public abstract System.Data.IsolationLevel IsolationLevel { get; }
763773
System.Data.IDbConnection System.Data.IDbTransaction.Connection { get { throw null; } }
764774
public abstract void Commit();
775+
public virtual System.Threading.Tasks.Task CommitAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
765776
public void Dispose() { }
777+
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
766778
protected virtual void Dispose(bool disposing) { }
767779
public abstract void Rollback();
780+
public virtual System.Threading.Tasks.Task RollbackAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
768781
}
769782
public enum GroupByBehavior
770783
{

0 commit comments

Comments
 (0)