diff --git a/src/libraries/System.Data.Common/ref/System.Data.Common.cs b/src/libraries/System.Data.Common/ref/System.Data.Common.cs index 7bcd618b806d23..ce62b2112e94da 100644 --- a/src/libraries/System.Data.Common/ref/System.Data.Common.cs +++ b/src/libraries/System.Data.Common/ref/System.Data.Common.cs @@ -1945,10 +1945,10 @@ public abstract class DbBatch : System.IDisposable, System.IAsyncDisposable public abstract class DbBatchCommand { public abstract string CommandText { get; set; } - public abstract CommandType CommandType { get; set; } + public abstract System.Data.CommandType CommandType { get; set; } public abstract int RecordsAffected { get; } - public DbParameterCollection Parameters { get { throw null; } } - protected abstract DbParameterCollection DbParameterCollection { get; } + public System.Data.Common.DbParameterCollection Parameters { get { throw null; } } + protected abstract System.Data.Common.DbParameterCollection DbParameterCollection { get; } } public abstract class DbBatchCommandCollection : System.Collections.Generic.IList { @@ -1964,7 +1964,9 @@ public abstract class DbBatchCommandCollection : System.Collections.Generic.ILis public abstract int IndexOf(DbBatchCommand item); public abstract void Insert(int index, DbBatchCommand item); public abstract void RemoveAt(int index); - public abstract DbBatchCommand this[int index] { get; set; } + public System.Data.Common.DbBatchCommand this[int index] { get { throw null; } set { throw null; } } + protected abstract System.Data.Common.DbBatchCommand GetBatchCommand(int index); + protected abstract void SetBatchCommand(int index, System.Data.Common.DbBatchCommand batchCommand); } public abstract partial class DbColumn { diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DbBatchCommandCollection.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DbBatchCommandCollection.cs index 736cc5cbb093f6..a41012d0672acf 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/DbBatchCommandCollection.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/DbBatchCommandCollection.cs @@ -32,6 +32,14 @@ public abstract class DbBatchCommandCollection : IList public abstract void RemoveAt(int index); - public abstract DbBatchCommand this[int index] { get; set; } + public DbBatchCommand this[int index] + { + get => GetBatchCommand(index); + set => SetBatchCommand(index, value); + } + + protected abstract DbBatchCommand GetBatchCommand(int index); + + protected abstract void SetBatchCommand(int index, DbBatchCommand batchCommand); } }