diff --git a/sdk/core/System.ClientModel/CHANGELOG.md b/sdk/core/System.ClientModel/CHANGELOG.md index 34052dbbf21ba..c589a2772e911 100644 --- a/sdk/core/System.ClientModel/CHANGELOG.md +++ b/sdk/core/System.ClientModel/CHANGELOG.md @@ -8,7 +8,7 @@ ### Breaking Changes -- Change `HttpClientPipelineTransport.Shared` from a field to a property. +- Changed `HttpClientPipelineTransport.Shared` and `ClientRetryPolicy.Default` from static readonly fields to static properties. ### Bugs Fixed diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs index a5442ec9e4e88..bcb221ba06f9a 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs @@ -78,8 +78,8 @@ public virtual void Freeze() { } } public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy { - public static readonly System.ClientModel.Primitives.ClientRetryPolicy Default; public ClientRetryPolicy(int maxRetries = 3) { } + public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } } protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; } protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { } protected virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(System.ClientModel.Primitives.PipelineMessage message) { throw null; } diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs index 928285a6edded..b67631bd1efa4 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs @@ -78,8 +78,8 @@ public virtual void Freeze() { } } public partial class ClientRetryPolicy : System.ClientModel.Primitives.PipelinePolicy { - public static readonly System.ClientModel.Primitives.ClientRetryPolicy Default; public ClientRetryPolicy(int maxRetries = 3) { } + public static System.ClientModel.Primitives.ClientRetryPolicy Default { get { throw null; } } protected virtual System.TimeSpan GetNextDelay(System.ClientModel.Primitives.PipelineMessage message, int tryCount) { throw null; } protected virtual void OnRequestSent(System.ClientModel.Primitives.PipelineMessage message) { } protected virtual System.Threading.Tasks.ValueTask OnRequestSentAsync(System.ClientModel.Primitives.PipelineMessage message) { throw null; } diff --git a/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs b/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs index 564f968b72738..03d68615c54bc 100644 --- a/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs +++ b/sdk/core/System.ClientModel/src/Pipeline/ClientRetryPolicy.cs @@ -12,7 +12,7 @@ namespace System.ClientModel.Primitives; public class ClientRetryPolicy : PipelinePolicy { - public static readonly ClientRetryPolicy Default = new(); + public static ClientRetryPolicy Default { get; } = new ClientRetryPolicy(); private const int DefaultMaxRetries = 3; private static readonly TimeSpan DefaultInitialDelay = TimeSpan.FromSeconds(0.8);