diff --git a/src/Polly.Core/PublicAPI.Unshipped.txt b/src/Polly.Core/PublicAPI.Unshipped.txt index 4b1c5591242..3b79f68fc08 100644 --- a/src/Polly.Core/PublicAPI.Unshipped.txt +++ b/src/Polly.Core/PublicAPI.Unshipped.txt @@ -268,12 +268,12 @@ Polly.ResilienceStrategyBuilder Polly.ResilienceStrategyBuilder.Build() -> Polly.ResilienceStrategy! Polly.ResilienceStrategyBuilder.ResilienceStrategyBuilder() -> void Polly.ResilienceStrategyBuilderBase -Polly.ResilienceStrategyBuilderBase.BuilderName.get -> string? -Polly.ResilienceStrategyBuilderBase.BuilderName.set -> void Polly.ResilienceStrategyBuilderBase.DiagnosticSource.get -> System.Diagnostics.DiagnosticSource? Polly.ResilienceStrategyBuilderBase.DiagnosticSource.set -> void Polly.ResilienceStrategyBuilderBase.InstanceName.get -> string? Polly.ResilienceStrategyBuilderBase.InstanceName.set -> void +Polly.ResilienceStrategyBuilderBase.Name.get -> string? +Polly.ResilienceStrategyBuilderBase.Name.set -> void Polly.ResilienceStrategyBuilderBase.OnCreatingStrategy.get -> System.Action!>? Polly.ResilienceStrategyBuilderBase.OnCreatingStrategy.set -> void Polly.ResilienceStrategyBuilderBase.Properties.get -> Polly.ResilienceProperties! diff --git a/src/Polly.Core/Registry/ResilienceStrategyRegistry.cs b/src/Polly.Core/Registry/ResilienceStrategyRegistry.cs index 87a3df1e288..00b0c92dc8f 100644 --- a/src/Polly.Core/Registry/ResilienceStrategyRegistry.cs +++ b/src/Polly.Core/Registry/ResilienceStrategyRegistry.cs @@ -273,7 +273,7 @@ private static ResilienceStrategy CreateStrategy( Func factory = () => { var builder = activator(); - builder.BuilderName = context.BuilderName; + builder.Name = context.BuilderName; builder.InstanceName = context.BuilderInstanceName; configure(builder, context); diff --git a/src/Polly.Core/ResilienceStrategyBuilderBase.cs b/src/Polly.Core/ResilienceStrategyBuilderBase.cs index 2e454f20a65..a2f46aca115 100644 --- a/src/Polly.Core/ResilienceStrategyBuilderBase.cs +++ b/src/Polly.Core/ResilienceStrategyBuilderBase.cs @@ -24,7 +24,7 @@ private protected ResilienceStrategyBuilderBase() private protected ResilienceStrategyBuilderBase(ResilienceStrategyBuilderBase other) { - BuilderName = other.BuilderName; + Name = other.Name; Properties = other.Properties; TimeProvider = other.TimeProvider; OnCreatingStrategy = other.OnCreatingStrategy; @@ -41,14 +41,14 @@ private protected ResilienceStrategyBuilderBase(ResilienceStrategyBuilderBase ot /// /// The default value is . /// - public string? BuilderName { get; set; } + public string? Name { get; set; } /// /// Gets or sets the instance name of the builder. /// /// /// This property is also included in the telemetry that is produced by the individual resilience strategies. - /// The instance name can be used to differentiate between multiple builder instances with the same . + /// The instance name can be used to differentiate between multiple builder instances with the same . /// /// /// The default value is . @@ -161,7 +161,7 @@ internal ResilienceStrategy BuildStrategy() private ResilienceStrategy CreateResilienceStrategy(Entry entry) { var context = new ResilienceStrategyBuilderContext( - builderName: BuilderName, + builderName: Name, builderInstanceName: InstanceName, builderProperties: Properties, strategyName: entry.Options.Name, diff --git a/src/Polly.Extensions/Telemetry/TelemetryResilienceStrategyBuilderExtensions.cs b/src/Polly.Extensions/Telemetry/TelemetryResilienceStrategyBuilderExtensions.cs index 37ebaa95717..7ee52d9f8d3 100644 --- a/src/Polly.Extensions/Telemetry/TelemetryResilienceStrategyBuilderExtensions.cs +++ b/src/Polly.Extensions/Telemetry/TelemetryResilienceStrategyBuilderExtensions.cs @@ -56,7 +56,7 @@ public static TBuilder ConfigureTelemetry(this TBuilder builder, Telem { var telemetryStrategy = new TelemetryResilienceStrategy( TimeProvider.System, - builder.BuilderName, + builder.Name, builder.InstanceName, options.LoggerFactory, options.ResultFormatter, diff --git a/test/Polly.Core.Tests/GenericResilienceStrategyBuilderTests.cs b/test/Polly.Core.Tests/GenericResilienceStrategyBuilderTests.cs index 099d7ca9d3f..aecc4ea33dc 100644 --- a/test/Polly.Core.Tests/GenericResilienceStrategyBuilderTests.cs +++ b/test/Polly.Core.Tests/GenericResilienceStrategyBuilderTests.cs @@ -10,7 +10,7 @@ public class GenericResilienceStrategyBuilderTests [Fact] public void Ctor_EnsureDefaults() { - _builder.BuilderName.Should().BeNull(); + _builder.Name.Should().BeNull(); _builder.Properties.Should().NotBeNull(); _builder.TimeProvider.Should().Be(TimeProvider.System); _builder.OnCreatingStrategy.Should().BeNull(); @@ -25,8 +25,8 @@ public void CopyCtor_Ok() [Fact] public void Properties_GetSet_Ok() { - _builder.BuilderName = "dummy"; - _builder.BuilderName.Should().Be("dummy"); + _builder.Name = "dummy"; + _builder.Name.Should().Be("dummy"); var timeProvider = new FakeTimeProvider(); _builder.TimeProvider = timeProvider; diff --git a/test/Polly.Core.Tests/Registry/ResilienceStrategyRegistryTests.cs b/test/Polly.Core.Tests/Registry/ResilienceStrategyRegistryTests.cs index 40f703af48b..15bbbd8fdc5 100644 --- a/test/Polly.Core.Tests/Registry/ResilienceStrategyRegistryTests.cs +++ b/test/Polly.Core.Tests/Registry/ResilienceStrategyRegistryTests.cs @@ -240,7 +240,7 @@ public void AddBuilder_EnsureStrategyKey() context.BuilderName.Should().Be("A"); context.BuilderInstanceName.Should().Be("Instance1"); builder.AddStrategy(new TestResilienceStrategy()); - builder.BuilderName.Should().Be("A"); + builder.Name.Should().Be("A"); called = true; }); @@ -270,7 +270,7 @@ public void AddBuilder_Generic_EnsureStrategyKey() registry.TryAddBuilder(StrategyId.Create("A"), (builder, _) => { builder.AddStrategy(new TestResilienceStrategy()); - builder.BuilderName.Should().Be("A"); + builder.Name.Should().Be("A"); builder.InstanceName.Should().Be("Instance1"); called = true; }); diff --git a/test/Polly.Core.Tests/ResilienceStrategyBuilderTests.cs b/test/Polly.Core.Tests/ResilienceStrategyBuilderTests.cs index 9bd3c154607..71f6396d0ce 100644 --- a/test/Polly.Core.Tests/ResilienceStrategyBuilderTests.cs +++ b/test/Polly.Core.Tests/ResilienceStrategyBuilderTests.cs @@ -13,7 +13,7 @@ public void Ctor_EnsureDefaults() { var builder = new ResilienceStrategyBuilder(); - builder.BuilderName.Should().BeNull(); + builder.Name.Should().BeNull(); builder.Properties.Should().NotBeNull(); builder.TimeProvider.Should().Be(TimeProvider.System); builder.Randomizer.Should().NotBeNull(); @@ -25,7 +25,7 @@ public void CopyCtor_Ok() var builder = new ResilienceStrategyBuilder { TimeProvider = Mock.Of(), - BuilderName = "dummy", + Name = "dummy", Randomizer = () => 0.0, DiagnosticSource = Mock.Of(), OnCreatingStrategy = _ => { }, @@ -34,7 +34,7 @@ public void CopyCtor_Ok() builder.Properties.Set(new ResiliencePropertyKey("dummy"), "dummy"); var other = new ResilienceStrategyBuilder(builder); - other.BuilderName.Should().Be(builder.BuilderName); + other.Name.Should().Be(builder.Name); other.TimeProvider.Should().Be(builder.TimeProvider); other.Randomizer.Should().BeSameAs(builder.Randomizer); other.DiagnosticSource.Should().BeSameAs(builder.DiagnosticSource); @@ -288,7 +288,7 @@ public void BuildStrategy_EnsureCorrectContext() var builder = new ResilienceStrategyBuilder { - BuilderName = "builder-name", + Name = "builder-name", TimeProvider = new FakeTimeProvider(), };