Skip to content

Commit cc0a25a

Browse files
committed
feat: 增加 Keyed 服务
1 parent a24242a commit cc0a25a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BootstrapBlazor/Extensions/BootstrapBlazorServiceCollectionExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public static IServiceCollection AddBootstrapBlazor(this IServiceCollection serv
5050
services.AddSingleton<IIpLocatorProvider, BaiduIpLocatorProvider>();
5151
services.AddSingleton<IIpLocatorProvider, BaiduIpLocatorProviderV2>();
5252

53+
#if NET8_0_OR_GREATER
54+
services.AddKeyedSingleton<IIpLocatorProvider, BaiduIpLocatorProvider>(nameof(BaiduIpLocatorProvider));
55+
services.AddKeyedSingleton<IIpLocatorProvider, BaiduIpLocatorProviderV2>(nameof(BaiduIpLocatorProviderV2));
56+
#endif
57+
5358
// 节日服务
5459
services.TryAddSingleton<ICalendarFestivals, DefaultCalendarFestivals>();
5560

0 commit comments

Comments
 (0)