File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.IP2Region/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33// Website: https://www.blazor.zone or https://argozhang.github.io/
44
55using BootstrapBlazor . Components ;
6+ using Microsoft . Extensions . DependencyInjection . Extensions ;
67
78namespace Microsoft . Extensions . DependencyInjection ;
89
@@ -12,14 +13,14 @@ namespace Microsoft.Extensions.DependencyInjection;
1213public static class BootstrapBlazoIP2RegionExtensions
1314{
1415 /// <summary>
15- /// 添加 AzureOpenAIService 服务
16+ /// 添加 IP2RegionService 服务
1617 /// </summary>
1718 /// <param name="services"></param>
18- public static IServiceCollection AddBootstrapBlazorIP2RegionfService ( this IServiceCollection services )
19+ public static IServiceCollection AddBootstrapBlazorIP2RegionService ( this IServiceCollection services )
1920 {
20- services . AddSingleton < IIpLocatorProvider , IP2RegionService > ( ) ;
21+ services . TryAddSingleton < IIpLocatorProvider , IP2RegionService > ( ) ;
2122#if NET8_0_OR_GREATER
22- services . AddKeyedSingleton < IIpLocatorProvider , IP2RegionService > ( "BootstrapBlazor.IP2Region" ) ;
23+ services . TryAddKeyedSingleton < IIpLocatorProvider , IP2RegionService > ( "BootstrapBlazor.IP2Region" ) ;
2324#endif
2425
2526 services . AddOptionsMonitor < IP2RegionOptions > ( ) ;
You can’t perform that action at this time.
0 commit comments