From 1c0080d9b42aede1416d65fedea4f84c4b4f14bd Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 6 Mar 2025 19:14:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E5=85=BC=E5=AE=B9=20Root=20?= =?UTF-8?q?=E5=A4=9A=E5=B1=82=E5=B5=8C=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/BootstrapBlazorRootRegisterService.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs b/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs index 8c6bf5f0048..73042cdea5f 100644 --- a/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs +++ b/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs @@ -77,7 +77,7 @@ public void Subscribe(object identifier, BootstrapBlazorRootOutlet subscriber) { if (_subscribersByIdentifier.ContainsKey(identifier)) { - throw new InvalidOperationException($"There is already a subscriber to the content with the given root ID '{identifier}'."); + return; } _subscribersByIdentifier.Add(identifier, subscriber); @@ -89,10 +89,7 @@ public void Subscribe(object identifier, BootstrapBlazorRootOutlet subscriber) /// public void Unsubscribe(object identifier) { - if (!_subscribersByIdentifier.Remove(identifier)) - { - throw new InvalidOperationException($"The subscriber with the given root ID '{identifier}' is already unsubscribed."); - } + _subscribersByIdentifier.Remove(identifier); } /// From 541b69221c646b370c2d4dd62db2bc25f1ff76cb Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 6 Mar 2025 19:14:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/BootstrapBlazorRootRegisterServiceTest.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/UnitTest/Services/BootstrapBlazorRootRegisterServiceTest.cs b/test/UnitTest/Services/BootstrapBlazorRootRegisterServiceTest.cs index 59dabbf2377..a8c6b900b17 100644 --- a/test/UnitTest/Services/BootstrapBlazorRootRegisterServiceTest.cs +++ b/test/UnitTest/Services/BootstrapBlazorRootRegisterServiceTest.cs @@ -28,11 +28,7 @@ public void Subscribe_Ok() var service = new BootstrapBlazorRootRegisterService(); var identifier = new object(); service.Subscribe(identifier, new BootstrapBlazorRootOutlet()); - var exception = Assert.ThrowsAny(() => service.Subscribe(identifier, new BootstrapBlazorRootOutlet())); - Assert.Equal("There is already a subscriber to the content with the given root ID 'System.Object'.", exception.Message); - - exception = Assert.ThrowsAny(() => service.Unsubscribe(new object())); - Assert.Equal("The subscriber with the given root ID 'System.Object' is already unsubscribed.", exception.Message); + service.Unsubscribe(new object()); } [Fact] From ca6eef747fae1276a7e5664ec7fae7aa1e8a01b8 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 6 Mar 2025 19:15:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/BootstrapBlazorRootRegisterService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs b/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs index 73042cdea5f..17437922b5a 100644 --- a/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs +++ b/src/BootstrapBlazor/Services/BootstrapBlazorRootRegisterService.cs @@ -14,7 +14,7 @@ public class BootstrapBlazorRootRegisterService private readonly Dictionary> _providersByIdentifier = []; /// - /// add provider + /// Add provider /// /// /// @@ -30,7 +30,7 @@ public void AddProvider(object identifier, BootstrapBlazorRootContent provider) } /// - /// remove provider + /// Remove provider /// /// /// @@ -58,7 +58,7 @@ public void RemoveProvider(object identifier, BootstrapBlazorRootContent provide } /// - /// get all providers by identifier + /// Get all providers by identifier /// /// /// @@ -69,7 +69,7 @@ public List GetProviders(object identifier) } /// - /// subscribe + /// Subscribe /// /// /// @@ -84,7 +84,7 @@ public void Subscribe(object identifier, BootstrapBlazorRootOutlet subscriber) } /// - /// 取消订阅 + /// Unsubscribe /// /// public void Unsubscribe(object identifier) From a718324ba931c9ee4eab1801cdfef341d376022c Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 6 Mar 2025 19:16:29 +0800 Subject: [PATCH 4/4] chore: bump version 9.4.7 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 893b793eefa..6a241dfeff2 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.4.7-beta04 + 9.4.7