From ec423d87e8e76a1d8c16512fc79352a2f20ae9ae Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Fri, 6 Sep 2019 07:28:28 +0200 Subject: [PATCH] Add missing IAsyncDisposable interfaces to System.Data Part of #35012 --- src/System.Data.Common/ref/System.Data.Common.cs | 8 ++++---- .../src/System/Data/Common/DbCommand.cs | 2 +- .../src/System/Data/Common/DbConnection.cs | 2 +- .../src/System/Data/Common/DbDataReader.cs | 2 +- .../src/System/Data/Common/DbTransaction.cs | 2 +- .../ApiCompatBaseline.netcoreapp.netstandardOnly.txt | 5 ----- src/shims/ApiCompatBaseline.uap.netstandardOnly.txt | 5 ----- 7 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/System.Data.Common/ref/System.Data.Common.cs b/src/System.Data.Common/ref/System.Data.Common.cs index 90071b974d5e..c0c639ce24e5 100644 --- a/src/System.Data.Common/ref/System.Data.Common.cs +++ b/src/System.Data.Common/ref/System.Data.Common.cs @@ -1796,7 +1796,7 @@ protected DbColumn() { } public int? NumericScale { get { throw null; } protected set { } } public string UdtAssemblyQualifiedName { get { throw null; } protected set { } } } - public abstract partial class DbCommand : System.ComponentModel.Component, System.Data.IDbCommand, System.IDisposable + public abstract partial class DbCommand : System.ComponentModel.Component, System.Data.IDbCommand, System.IDisposable, System.IAsyncDisposable { protected DbCommand() { } [System.ComponentModel.DefaultValueAttribute("")] @@ -1893,7 +1893,7 @@ protected void RowUpdatingHandler(System.Data.Common.RowUpdatingEventArgs rowUpd protected abstract void SetRowUpdatingHandler(System.Data.Common.DbDataAdapter adapter); public virtual string UnquoteIdentifier(string quotedIdentifier) { throw null; } } - public abstract partial class DbConnection : System.ComponentModel.Component, System.Data.IDbConnection, System.IDisposable + public abstract partial class DbConnection : System.ComponentModel.Component, System.Data.IDbConnection, System.IDisposable, System.IAsyncDisposable { protected DbConnection() { } [System.ComponentModel.DefaultValueAttribute("")] @@ -2050,7 +2050,7 @@ protected virtual void TerminateBatching() { } public int Update(System.Data.DataSet dataSet, string srcTable) { throw null; } public int Update(System.Data.DataTable dataTable) { throw null; } } - public abstract partial class DbDataReader : System.MarshalByRefObject, System.Collections.IEnumerable, System.Data.IDataReader, System.Data.IDataRecord, System.IDisposable + public abstract partial class DbDataReader : System.MarshalByRefObject, System.Collections.IEnumerable, System.Data.IDataReader, System.Data.IDataRecord, System.IDisposable, System.IAsyncDisposable { protected DbDataReader() { } public abstract int Depth { get; } @@ -2353,7 +2353,7 @@ public sealed partial class DbProviderSpecificTypePropertyAttribute : System.Att public DbProviderSpecificTypePropertyAttribute(bool isProviderSpecificTypeProperty) { } public bool IsProviderSpecificTypeProperty { get { throw null; } } } - public abstract partial class DbTransaction : System.MarshalByRefObject, System.Data.IDbTransaction, System.IDisposable + public abstract partial class DbTransaction : System.MarshalByRefObject, System.Data.IDbTransaction, System.IDisposable, System.IAsyncDisposable { protected DbTransaction() { } public System.Data.Common.DbConnection Connection { get { throw null; } } diff --git a/src/System.Data.Common/src/System/Data/Common/DbCommand.cs b/src/System.Data.Common/src/System/Data/Common/DbCommand.cs index d2e5db1a46fa..3631090afb93 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbCommand.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbCommand.cs @@ -8,7 +8,7 @@ namespace System.Data.Common { - public abstract class DbCommand : Component, IDbCommand + public abstract class DbCommand : Component, IDbCommand, IAsyncDisposable { protected DbCommand() : base() { 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 b58290fefe3a..8e97543b995d 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbConnection.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbConnection.cs @@ -8,7 +8,7 @@ namespace System.Data.Common { - public abstract class DbConnection : Component, IDbConnection + public abstract class DbConnection : Component, IDbConnection, IAsyncDisposable { #pragma warning disable 649 // ignore unassigned field warning internal bool _suppressStateChangeForReconnection; 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 9144c2f0061f..bb86911e22d4 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbDataReader.cs @@ -10,7 +10,7 @@ namespace System.Data.Common { - public abstract class DbDataReader : MarshalByRefObject, IDataReader, IEnumerable + public abstract class DbDataReader : MarshalByRefObject, IDataReader, IEnumerable, IAsyncDisposable { protected DbDataReader() : base() { } diff --git a/src/System.Data.Common/src/System/Data/Common/DbTransaction.cs b/src/System.Data.Common/src/System/Data/Common/DbTransaction.cs index c1342b456ee3..484d432508df 100644 --- a/src/System.Data.Common/src/System/Data/Common/DbTransaction.cs +++ b/src/System.Data.Common/src/System/Data/Common/DbTransaction.cs @@ -7,7 +7,7 @@ namespace System.Data.Common { - public abstract class DbTransaction : MarshalByRefObject, IDbTransaction + public abstract class DbTransaction : MarshalByRefObject, IDbTransaction, IAsyncDisposable { protected DbTransaction() : base() { } diff --git a/src/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt b/src/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt index 0e856d49875e..0938df4681fc 100644 --- a/src/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt +++ b/src/shims/ApiCompatBaseline.netcoreapp.netstandardOnly.txt @@ -3,11 +3,6 @@ CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultEventAttribute' CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultEventAttribute' exists on 'System.Diagnostics.Process' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultPropertyAttribute' exists on 'System.Diagnostics.Process' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.DefaultEventAttribute' exists on 'System.IO.FileSystemWatcher' in the contract but not the implementation. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.DataTableReader' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbCommand' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbConnection' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbDataReader' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbTransaction' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Method, Inherited=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Method, Inherited=false, AllowMultiple=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Xml.Serialization.XmlAnyAttributeAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Xml.Serialization.XmlNamespaceDeclarationsAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple=false)]' in the implementation. diff --git a/src/shims/ApiCompatBaseline.uap.netstandardOnly.txt b/src/shims/ApiCompatBaseline.uap.netstandardOnly.txt index 947514e54509..d7fcc227886f 100644 --- a/src/shims/ApiCompatBaseline.uap.netstandardOnly.txt +++ b/src/shims/ApiCompatBaseline.uap.netstandardOnly.txt @@ -16,11 +16,6 @@ TypesMustExist : Type 'System.Diagnostics.Tracing.PollingCounter' does not exist TypesMustExist : Type 'System.IO.Compression.BrotliDecoder' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.IO.Compression.BrotliEncoder' does not exist in the implementation but it does exist in the contract. TypesMustExist : Type 'System.IO.Compression.BrotliStream' does not exist in the implementation but it does exist in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.DataTableReader' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbCommand' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbConnection' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbDataReader' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Data.Common.DbTransaction' does not implement interface 'System.IAsyncDisposable' in the implementation but it does in the contract. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Method, Inherited=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Method, Inherited=false, AllowMultiple=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Xml.Serialization.XmlAnyAttributeAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Xml.Serialization.XmlNamespaceDeclarationsAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple=false)]' in the implementation.