Skip to content

Commit d73219c

Browse files
committed
refactor: 更新服务
1 parent 25767c0 commit d73219c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/BootstrapBlazor.IP2Region/Extensions/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

@@ -18,9 +18,9 @@ public static class BootstrapBlazoIP2RegionExtensions
1818
/// <param name="services"></param>
1919
public static IServiceCollection AddBootstrapBlazorIP2RegionService(this IServiceCollection services)
2020
{
21-
services.TryAddSingleton<IIpLocatorProvider, IP2RegionService>();
21+
services.AddSingleton<IIpLocatorProvider, IP2RegionService>();
2222
#if NET8_0_OR_GREATER
23-
services.TryAddKeyedSingleton<IIpLocatorProvider, IP2RegionService>("BootstrapBlazor.IP2Region");
23+
services.AddKeyedSingleton<IIpLocatorProvider, IP2RegionService>("BootstrapBlazor.IP2Region");
2424
#endif
2525

2626
services.AddOptionsMonitor<IP2RegionOptions>();

0 commit comments

Comments
 (0)