diff --git a/src/Polly.Core/ResilienceValidationContext.cs b/src/Polly.Core/ResilienceValidationContext.cs index f0637027c62..6657fc88ebb 100644 --- a/src/Polly.Core/ResilienceValidationContext.cs +++ b/src/Polly.Core/ResilienceValidationContext.cs @@ -1,4 +1,6 @@ -namespace Polly; +using Polly.Utils; + +namespace Polly; /// /// The validation context that encapsulates parameters for the validation. @@ -12,8 +14,8 @@ internal sealed class ResilienceValidationContext /// The primary validation message. public ResilienceValidationContext(object instance, string primaryMessage) { - Instance = Polly.Utils.Guard.NotNull(instance); - PrimaryMessage = Polly.Utils.Guard.NotNull(primaryMessage); + Instance = Guard.NotNull(instance); + PrimaryMessage = Guard.NotNull(primaryMessage); } /// diff --git a/src/Polly/AsyncPolicy.ExecuteOverloads.cs b/src/Polly/AsyncPolicy.ExecuteOverloads.cs index 86b7f683f8f..e038e21a51d 100644 --- a/src/Polly/AsyncPolicy.ExecuteOverloads.cs +++ b/src/Polly/AsyncPolicy.ExecuteOverloads.cs @@ -478,7 +478,7 @@ private async Task ExecuteInternalAsync(Func a } finally { - PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); + RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); } } @@ -496,7 +496,7 @@ private async Task ExecuteInternalAsync( } finally { - PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); + RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); } } diff --git a/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs b/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs index 549cf6fedf7..2c3984053fc 100644 --- a/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs +++ b/src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs @@ -238,7 +238,7 @@ private async Task ExecuteInternalAsync( } finally { - PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); + RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); } } diff --git a/src/Polly/Policy.ExecuteOverloads.cs b/src/Polly/Policy.ExecuteOverloads.cs index ce9e1ef6fa2..e003effbd61 100644 --- a/src/Polly/Policy.ExecuteOverloads.cs +++ b/src/Polly/Policy.ExecuteOverloads.cs @@ -72,7 +72,7 @@ public void Execute(Action action, Context context, } finally { - PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); + RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); } } @@ -160,7 +160,7 @@ public TResult Execute(Func action } finally { - PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); + RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); } } diff --git a/src/Polly/Policy.TResult.ExecuteOverloads.cs b/src/Polly/Policy.TResult.ExecuteOverloads.cs index 7050636310f..f69e094d38d 100644 --- a/src/Polly/Policy.TResult.ExecuteOverloads.cs +++ b/src/Polly/Policy.TResult.ExecuteOverloads.cs @@ -80,7 +80,7 @@ public TResult Execute(Func action, Context } finally { - PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); + RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey); } } diff --git a/src/Polly/Utilities/TimedLock.cs b/src/Polly/Utilities/TimedLock.cs index cedb0d1b244..0bfb9bb177b 100644 --- a/src/Polly/Utilities/TimedLock.cs +++ b/src/Polly/Utilities/TimedLock.cs @@ -80,7 +80,7 @@ private sealed class Sentinel // If this finalizer runs, someone somewhere failed to // call Dispose, which means we've failed to leave // a monitor! - System.Diagnostics.Debug.Fail("Undisposed lock"); + Debug.Fail("Undisposed lock"); } #endif } diff --git a/src/Snippets/Docs/ResiliencePipelines.cs b/src/Snippets/Docs/ResiliencePipelines.cs index e1f4eb1e3f7..d02b400c5e3 100644 --- a/src/Snippets/Docs/ResiliencePipelines.cs +++ b/src/Snippets/Docs/ResiliencePipelines.cs @@ -122,7 +122,7 @@ public static void ResiliencePipelinesDiagramTimeoutRetryTimeout() public static async Task ExecuteOutcomeAsync() { - var pipeline = Polly.ResiliencePipeline.Empty; + var pipeline = ResiliencePipeline.Empty; #region resilience-pipeline-outcome