From 366c21a843fc4785f51a89bc8efc3322233725d5 Mon Sep 17 00:00:00 2001 From: Davoud Eshtehari Date: Fri, 25 Sep 2020 23:53:44 -0700 Subject: [PATCH] Use abstract instead interface --- .../src/Microsoft.Data.SqlClient.csproj | 8 +- .../Common/ISqlRetryIntervalEnumerator.cs | 30 ----- .../Common/SqlRetryIntervalBaseEnumerator.cs | 121 ++++++++++++++++++ .../Common/SqlRetryIntervalEnumerator.cs | 78 ----------- .../Data/Reliability/Common/SqlRetryLogic.cs | 21 +-- ...ISqlRetryLogic.cs => SqlRetryLogicBase.cs} | 16 +-- ...ovider.cs => SqlRetryLogicBaseProvider.cs} | 14 +- .../Common/SqlRetryLogicProvider.cs | 53 ++------ .../Common/SqlRetryingEventArgs.cs | 48 +++++++ .../SqlRetryIntervalEnumerators.cs | 8 +- .../Microsoft/Data/SqlClient/SqlCommand.cs | 4 +- .../Microsoft/Data/SqlClient/SqlConnection.cs | 4 +- 12 files changed, 214 insertions(+), 191 deletions(-) delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryIntervalEnumerator.cs create mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalBaseEnumerator.cs delete mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalEnumerator.cs rename src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/{ISqlRetryLogic.cs => SqlRetryLogicBase.cs} (74%) rename src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/{ISqlRetryLogicProvider.cs => SqlRetryLogicBaseProvider.cs} (77%) create mode 100644 src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryingEventArgs.cs diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj index dbc8ad2e09..4facf074b8 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj @@ -709,11 +709,11 @@ - - - + + + - + diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryIntervalEnumerator.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryIntervalEnumerator.cs deleted file mode 100644 index 3a48e9a2e2..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryIntervalEnumerator.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; - -namespace Microsoft.Data.SqlClient.Reliability -{ - /// - /// Generates a sequence of the time intervals. - /// - public interface ISqlRetryIntervalEnumerator : IEnumerator - { - /// - /// Maximum time interval value. - /// - TimeSpan MaxTimeInterval { get; } - - /// - /// Minimum time interval value. - /// - TimeSpan MinTimeInterval { get; } - - /// - /// The gap time of each interval - /// - TimeSpan GapTimeInterval { get; } - } -} diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalBaseEnumerator.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalBaseEnumerator.cs new file mode 100644 index 0000000000..a427804a59 --- /dev/null +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalBaseEnumerator.cs @@ -0,0 +1,121 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Data.SqlClient +{ + /// + /// Generates a sequence of the time intervals. + /// + public abstract class SqlRetryIntervalBaseEnumerator : IEnumerator + { + /// + /// The gap time of each interval + /// + public TimeSpan GapTimeInterval { get; protected set; } + + /// + /// Maximum time interval value. + /// + public TimeSpan MaxTimeInterval { get; protected set; } + + /// + /// Minimum time interval value. + /// + public TimeSpan MinTimeInterval { get; protected set; } + + /// + /// Gets the element in the collection at the current position of the enumerator. + /// + public TimeSpan Current { get; private set; } = TimeSpan.Zero; + + object IEnumerator.Current => Current; + + /// + /// Constructor + /// + public SqlRetryIntervalBaseEnumerator() + { + GapTimeInterval = TimeSpan.Zero; + MaxTimeInterval = TimeSpan.Zero; + MinTimeInterval = TimeSpan.Zero; + } + + /// + /// Constructor + /// + public SqlRetryIntervalBaseEnumerator(TimeSpan timeInterval, TimeSpan maxTime, TimeSpan minTime) + { + Validate(timeInterval, maxTime, minTime); + GapTimeInterval = timeInterval; + MaxTimeInterval = maxTime; + MinTimeInterval = minTime; + } + + /// + /// Sets the enumerator to its initial position, which is before the first element in the collection. + /// + public virtual void Reset() + { + Current = TimeSpan.Zero; + } + + /// + /// Validate the enumeration parameters. + /// + /// The gap time of each interval + /// Maximum time interval value. + /// Minimum time interval value. + protected virtual void Validate(TimeSpan timeInterval, TimeSpan maxTimeInterval, TimeSpan minTimeInterval) + { + // valid time iterval must be between 0 and 2 minutes + // TODO: grab the localized messages from the resource file + if(timeInterval.TotalMinutes > 2) + { + throw new ArgumentOutOfRangeException(nameof(timeInterval)); + } + else if (maxTimeInterval < minTimeInterval) + { + throw new ArgumentOutOfRangeException(nameof(maxTimeInterval)); + } + } + + /// + /// Calculate the next interval time. + /// + /// Next time interval + protected abstract TimeSpan GetNextInterval(); + + /// + /// Advances the enumerator to the next element of the collection. + /// + /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. + public virtual bool MoveNext() + { + TimeSpan next = Current; + if (Current < MaxTimeInterval) + { + next = GetNextInterval(); + } + + bool result = next <= MaxTimeInterval; + if (result) + { + Current = next; + } + + return result; + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public virtual void Dispose() + { + } + } +} diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalEnumerator.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalEnumerator.cs deleted file mode 100644 index fb709b07dc..0000000000 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryIntervalEnumerator.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections; - -namespace Microsoft.Data.SqlClient.Reliability -{ - internal abstract class SqlRetryIntervalEnumerator : ISqlRetryIntervalEnumerator - { - public TimeSpan GapTimeInterval { get; protected set; } - - public TimeSpan MaxTimeInterval { get; protected set; } - - public TimeSpan MinTimeInterval { get; protected set; } - - public TimeSpan Current { get; private set; } = TimeSpan.Zero; - - object IEnumerator.Current => Current; - - public SqlRetryIntervalEnumerator() - { - GapTimeInterval = TimeSpan.Zero; - MaxTimeInterval = TimeSpan.Zero; - MinTimeInterval = TimeSpan.Zero; - } - - public SqlRetryIntervalEnumerator(TimeSpan timeInterval, TimeSpan maxTime, TimeSpan minTime) - { - Validate(timeInterval, maxTime, minTime); - GapTimeInterval = timeInterval; - MaxTimeInterval = maxTime; - MinTimeInterval = minTime; - } - - public void Reset() - { - Current = TimeSpan.Zero; - } - - private void Validate(TimeSpan timeInterval, TimeSpan maxTimeInterval, TimeSpan minTimeInterval) - { - // valid time iterval must be between 0 and 60 minutes - // TODO: grab the localized messages from the resource file - if(timeInterval.TotalSeconds > 3600) - { - throw new ArgumentOutOfRangeException(nameof(timeInterval)); - } - else if (maxTimeInterval < minTimeInterval) - { - throw new ArgumentOutOfRangeException(nameof(maxTimeInterval)); - } - } - - protected abstract TimeSpan GetNextInterval(); - - public bool MoveNext() - { - TimeSpan next = Current; - if (Current < MaxTimeInterval) - { - next = GetNextInterval(); - } - - bool result = next <= MaxTimeInterval; - if (result) - { - Current = next; - } - - return result; - } - public virtual void Dispose() - { - } - } -} diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogic.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogic.cs index 10e1816226..386d326aa9 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogic.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogic.cs @@ -6,39 +6,32 @@ namespace Microsoft.Data.SqlClient.Reliability { - internal class SqlRetryLogic : ISqlRetryLogic + internal class SqlRetryLogic : SqlRetryLogicBase { private const int firstCounter = 1; - public int NumberOfTries { get; private set; } - - public ISqlRetryIntervalEnumerator RetryIntervalEnumerator { get; private set; } - - public Predicate TransientPredicate { get; private set; } - - public int Current { get; private set; } = firstCounter; - - public SqlRetryLogic(int numberOfTries, ISqlRetryIntervalEnumerator enumerator, Predicate transientPredicate) + public SqlRetryLogic(int numberOfTries, SqlRetryIntervalBaseEnumerator enumerator, Predicate transientPredicate) { Validate(numberOfTries, enumerator, transientPredicate); NumberOfTries = numberOfTries; RetryIntervalEnumerator = enumerator; TransientPredicate = transientPredicate; + Current = firstCounter; } - public SqlRetryLogic(ISqlRetryIntervalEnumerator enumerator, Predicate transientPredicate = null) + public SqlRetryLogic(SqlRetryIntervalBaseEnumerator enumerator, Predicate transientPredicate = null) : this(firstCounter, enumerator, transientPredicate ?? (_ => false)) { } - public void Reset() + public override void Reset() { Current = firstCounter; RetryIntervalEnumerator.Reset(); } - private void Validate(int numberOfTries, ISqlRetryIntervalEnumerator enumerator, Predicate transientPredicate) + private void Validate(int numberOfTries, SqlRetryIntervalBaseEnumerator enumerator, Predicate transientPredicate) { if (numberOfTries < firstCounter) { @@ -54,7 +47,7 @@ private void Validate(int numberOfTries, ISqlRetryIntervalEnumerator enumerator, } } - public bool TryNextInterval(out TimeSpan intervalTime) + public override bool TryNextInterval(out TimeSpan intervalTime) { intervalTime = TimeSpan.Zero; bool result = Current < NumberOfTries; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryLogic.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicBase.cs similarity index 74% rename from src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryLogic.cs rename to src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicBase.cs index e7a1c81c7c..4f66d62bb2 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryLogic.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicBase.cs @@ -4,44 +4,44 @@ using System; -namespace Microsoft.Data.SqlClient.Reliability +namespace Microsoft.Data.SqlClient { /// /// It retrieves next time interval with respect to the number of retries if transient condition happens. /// - public interface ISqlRetryLogic + public abstract class SqlRetryLogicBase { /// /// Number of retries. /// - int NumberOfTries { get; } + public int NumberOfTries { get; protected set; } /// /// Current retry number. /// - int Current { get; } + public int Current { get; protected set; } /// /// The timer interval enumerator. /// - ISqlRetryIntervalEnumerator RetryIntervalEnumerator { get; } + public SqlRetryIntervalBaseEnumerator RetryIntervalEnumerator { get; protected set; } /// /// Delegate to a transient condition predicator. /// The function that this delegate points to it must return a true value when an expected transient exception happens. /// - Predicate TransientPredicate { get; } + public Predicate TransientPredicate { get; protected set; } /// /// Try to get the next interval time by the enumerator if the counter does not exceed from the number of retries. /// /// The interval time that is generated by the enumerator /// True if the number of retries does not exceed unless False - bool TryNextInterval(out TimeSpan intervalTime); + public abstract bool TryNextInterval(out TimeSpan intervalTime); /// /// Set the counters and enumerator to default values for next use. /// - void Reset(); + public abstract void Reset(); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryLogicProvider.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicBaseProvider.cs similarity index 77% rename from src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryLogicProvider.cs rename to src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicBaseProvider.cs index 534a1ae3c6..f5f5e45f0c 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/ISqlRetryLogicProvider.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicBaseProvider.cs @@ -5,24 +5,23 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.Data.SqlClient.Reliability; namespace Microsoft.Data.SqlClient { /// /// Apply a retry logic on an operation. /// - public interface ISqlRetryLogicProvider + public abstract class SqlRetryLogicBaseProvider { /// /// This event raises exactly before time delay in retry the operation again. /// - EventHandler Retrying { get; set; } + public EventHandler Retrying { get; set; } /// /// Defined retry logic /// - ISqlRetryLogic RetryLogic { get; } + public SqlRetryLogicBase RetryLogic { get; protected set; } /// /// Executes a function with a TResult type. @@ -30,7 +29,7 @@ public interface ISqlRetryLogicProvider /// The function return type /// The operaiton is likly be in the retry logic if transient condition happens /// A TResult object or an exception - TResult Execute(Func function); + public abstract TResult Execute(Func function); /// /// Executes a function with a generic Task and TResult type. @@ -39,8 +38,7 @@ public interface ISqlRetryLogicProvider /// The operaiton is likly be in the retry logic if transient condition happens /// The cancellation instruction /// A task representing TResult or an exception - Task ExecuteAsync(Func> function, CancellationToken cancellationToken = default); - + public abstract Task ExecuteAsync(Func> function, CancellationToken cancellationToken = default); /// /// Execute a function with a generic Task type. @@ -48,6 +46,6 @@ public interface ISqlRetryLogicProvider /// The operaiton is likly be in the retry logic if transient condition happens /// The cancellation instruction /// A Task or an exception - Task ExecuteAsync(Func function, CancellationToken cancellationToken = default); + public abstract Task ExecuteAsync(Func function, CancellationToken cancellationToken = default); } } diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicProvider.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicProvider.cs index 4845a9c334..587398101b 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicProvider.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryLogicProvider.cs @@ -7,44 +7,18 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.Data.SqlClient.Reliability +namespace Microsoft.Data.SqlClient { - /// provide retry information on each attemp - public class SqlRetryingEventArgs : EventArgs - { - - /// - public SqlRetryingEventArgs(int retryCount, TimeSpan delay, IList exceptions) - { - RetryCount = retryCount; - Delay = delay; - Exceptions = exceptions; - } - - /// retry-attempt-number, after the fisrt exception occurrence - public int RetryCount { get; private set; } - - /// current waiting time in millisecond - public TimeSpan Delay { get; private set; } - - /// if set to true retry will intruppted immidiately - public bool Cancel { get; set; } = false; - - /// list of exceptions since first happening - public IList Exceptions { get; private set; } - } - - /// - public abstract class SqlRetryLogicProvider : ISqlRetryLogicProvider + /// + /// Apply a retry logic on an operation. + /// + public abstract class SqlRetryLogicProvider : SqlRetryLogicBaseProvider { // safety switch for the preview version private const string EnableRetryLogicSwitch = "Switch.Microsoft.Data.SqlClient.EnableRetryLogic"; private bool EnableRetryLogic = false; - /// - public EventHandler Retrying { set; get; } - - /// + /// public SqlRetryLogicProvider() { AppContext.TryGetSwitch(EnableRetryLogicSwitch, out EnableRetryLogic); @@ -55,11 +29,8 @@ private void OnRetrying(SqlRetryingEventArgs eventArgs) Retrying?.Invoke(this, eventArgs); } - /// - public ISqlRetryLogic RetryLogic { get; protected set; } - - /// - public TResult Execute(Func function) + /// + public override TResult Execute(Func function) { var exceptions = new List(); retry: @@ -92,8 +63,8 @@ public TResult Execute(Func function) } } - /// - public async Task ExecuteAsync(Func> function, CancellationToken cancellationToken = default) + /// + public override async Task ExecuteAsync(Func> function, CancellationToken cancellationToken = default) { var exceptions = new List(); retry: @@ -126,8 +97,8 @@ public async Task ExecuteAsync(Func> function, C } } - /// - public async Task ExecuteAsync(Func function, CancellationToken cancellationToken = default) + /// + public override async Task ExecuteAsync(Func function, CancellationToken cancellationToken = default) { var exceptions = new List(); retry: diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryingEventArgs.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryingEventArgs.cs new file mode 100644 index 0000000000..5d83fd5618 --- /dev/null +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/Common/SqlRetryingEventArgs.cs @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.SqlClient +{ + /// + /// provide retry information on each attemp + /// + public class SqlRetryingEventArgs : EventArgs + { + /// + /// Contains information that is required for a retry. + /// + /// The current retry attempt count. + /// The delay that indicates how long the current thread will be suspended before the next iteration is invoked. + /// The exceptions since the first retry that caused the retry conditions to occur. + public SqlRetryingEventArgs(int retryCount, TimeSpan delay, IList exceptions) + { + RetryCount = retryCount; + Delay = delay; + Exceptions = exceptions; + } + + /// + /// Retry-attempt-number, after the fisrt exception occurrence. + /// + public int RetryCount { get; private set; } + + /// + /// The current waiting time in millisecond. + /// + public TimeSpan Delay { get; private set; } + + /// + /// If set to true retry will intruppted immidiately. + /// + public bool Cancel { get; set; } = false; + + /// + /// The list of exceptions since the first rettry. + /// + public IList Exceptions { get; private set; } + } +} diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/SqlRetryIntervalEnumerators.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/SqlRetryIntervalEnumerators.cs index 8bc31f2e90..b317532bf9 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/SqlRetryIntervalEnumerators.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/Reliability/SqlRetryIntervalEnumerators.cs @@ -6,7 +6,7 @@ namespace Microsoft.Data.SqlClient.Reliability { - internal class SqlExponentialIntervalEnumerator : SqlRetryIntervalEnumerator + internal class SqlExponentialIntervalEnumerator : SqlRetryIntervalBaseEnumerator { private int internalCounter = 1; @@ -25,7 +25,7 @@ protected override TimeSpan GetNextInterval() } } - internal class SqlIncrementalIntervalEnumerator : SqlRetryIntervalEnumerator + internal class SqlIncrementalIntervalEnumerator : SqlRetryIntervalBaseEnumerator { public SqlIncrementalIntervalEnumerator(TimeSpan timeInterval, TimeSpan maxTimeInterval, TimeSpan minTimeInterval) : base(timeInterval, maxTimeInterval, minTimeInterval) @@ -49,7 +49,7 @@ protected override TimeSpan GetNextInterval() } } - internal class SqlFixedIntervalEnumerator : SqlRetryIntervalEnumerator + internal class SqlFixedIntervalEnumerator : SqlRetryIntervalBaseEnumerator { public SqlFixedIntervalEnumerator(TimeSpan gapTimeInterval, TimeSpan maxTimeInterval, TimeSpan minTimeInterval) : base(gapTimeInterval, maxTimeInterval, minTimeInterval) @@ -62,7 +62,7 @@ protected override TimeSpan GetNextInterval() } } - internal class SqlNoneIntervalEnumerator : SqlRetryIntervalEnumerator + internal class SqlNoneIntervalEnumerator : SqlRetryIntervalBaseEnumerator { protected override TimeSpan GetNextInterval() { diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs index 5a086cdef9..0685602938 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs @@ -323,7 +323,7 @@ private CachedAsyncState cachedAsyncState private _SqlRPC[] _sqlRPCParameterEncryptionReqArray; private List _parameterCollectionList; private int _currentlyExecutingBatch; - private ISqlRetryLogicProvider _retryLogicProvider; + private SqlRetryLogicBaseProvider _retryLogicProvider; /// /// This variable is used to keep track of which RPC batch's results are being read when reading the results of @@ -477,7 +477,7 @@ private SqlInternalConnectionTds InternalTdsConnection } /// - public ISqlRetryLogicProvider RetryLogicProvider + public SqlRetryLogicBaseProvider RetryLogicProvider { get { diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs index 6ccbe6a7ae..f20d39b358 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs @@ -61,7 +61,7 @@ private enum CultureCheckState : uint private int _reconnectCount; // Retry Logic - private ISqlRetryLogicProvider _retryLogicProvider; + private SqlRetryLogicBaseProvider _retryLogicProvider; // diagnostics listener private static readonly SqlDiagnosticListener s_diagnosticListener = new SqlDiagnosticListener(SqlClientDiagnosticListenerExtensions.DiagnosticListenerName); @@ -105,7 +105,7 @@ private static readonly ConcurrentDictionary> _ColumnEncry private static readonly Action, object> s_openAsyncComplete = OpenAsyncComplete; /// - public ISqlRetryLogicProvider RetryLogicProvider + public SqlRetryLogicBaseProvider RetryLogicProvider { get {