From aa72a5464b92c3ad909cc0688f43e733b95b7e35 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Oct 2025 15:43:35 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=E6=94=B9=E7=94=A8=20TryAdd=20?= =?UTF-8?q?=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/ServiceCollectionExtensions.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs index d7a982e5..ecf423c0 100644 --- a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs +++ b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs @@ -3,6 +3,7 @@ // Website: https://www.blazor.zone or https://argozhang.github.io/ using BootstrapBlazor.Components; +using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection; @@ -12,14 +13,14 @@ namespace Microsoft.Extensions.DependencyInjection; public static class BootstrapBlazoIP2RegionExtensions { /// - /// 添加 AzureOpenAIService 服务 + /// 添加 IP2RegionService 服务 /// /// - public static IServiceCollection AddBootstrapBlazorIP2RegionfService(this IServiceCollection services) + public static IServiceCollection AddBootstrapBlazorIP2RegionService(this IServiceCollection services) { - services.AddSingleton(); + services.TryAddSingleton(); #if NET8_0_OR_GREATER - services.AddKeyedSingleton("BootstrapBlazor.IP2Region"); + services.TryAddKeyedSingleton("BootstrapBlazor.IP2Region"); #endif services.AddOptionsMonitor(); From 25767c0ba8dc173d4cf64cfc3150cb79354654eb Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Oct 2025 15:43:51 +0800 Subject: [PATCH 2/5] chore: bump version 9.0.4 --- .../BootstrapBlazor.IP2Region/BootstrapBlazor.IP2Region.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.IP2Region/BootstrapBlazor.IP2Region.csproj b/src/components/BootstrapBlazor.IP2Region/BootstrapBlazor.IP2Region.csproj index 20aba966..78424cf5 100644 --- a/src/components/BootstrapBlazor.IP2Region/BootstrapBlazor.IP2Region.csproj +++ b/src/components/BootstrapBlazor.IP2Region/BootstrapBlazor.IP2Region.csproj @@ -1,7 +1,7 @@  - 9.0.3 + 9.0.4 From d73219cab982e2d737c36d571112c6f8782f29cf Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Oct 2025 15:54:46 +0800 Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/ServiceCollectionExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs index ecf423c0..9fd10f47 100644 --- a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs +++ b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -18,9 +18,9 @@ public static class BootstrapBlazoIP2RegionExtensions /// public static IServiceCollection AddBootstrapBlazorIP2RegionService(this IServiceCollection services) { - services.TryAddSingleton(); + services.AddSingleton(); #if NET8_0_OR_GREATER - services.TryAddKeyedSingleton("BootstrapBlazor.IP2Region"); + services.AddKeyedSingleton("BootstrapBlazor.IP2Region"); #endif services.AddOptionsMonitor(); From 91c525422ee0635a9bea9464ed9f89caa8bff2d3 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Oct 2025 15:56:53 +0800 Subject: [PATCH 4/5] =?UTF-8?q?refactor:=20=E7=B2=BE=E7=AE=80=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/ServiceCollectionExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs index 9fd10f47..54859d44 100644 --- a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs +++ b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs @@ -3,7 +3,6 @@ // Website: https://www.blazor.zone or https://argozhang.github.io/ using BootstrapBlazor.Components; -using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection; From 0e8c944ad8d80355d9abf068774c9311dd7a3b62 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Oct 2025 15:58:14 +0800 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E7=B1=BB?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/ServiceCollectionExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs index 54859d44..2f720faf 100644 --- a/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs +++ b/src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.DependencyInjection; /// /// BootstrapBlazor 服务扩展类 /// -public static class BootstrapBlazoIP2RegionExtensions +public static class ServiceCollectionExtensions { /// /// 添加 IP2RegionService 服务