Skip to content

Commit 9e69ecb

Browse files
committed
修改Options的name,防止冲突的可能
1 parent 7a08579 commit 9e69ecb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

WebApiClientCore.Extensions.OAuths/DependencyInjection/TokenProviderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static ITokenProviderBuilder AddTokenProviderCore<THttpApi, TTokenProvid
7474
.Configure(o => o.Register<THttpApi, TTokenProvider>());
7575

7676
services
77-
.AddOptions<HttpApiOptions>(nameof(OAuth2TokenClient))
77+
.AddOptions<HttpApiOptions>(HttpApi.GetName(typeof(OAuth2TokenClient)))
7878
.Configure(o => o.KeyValueSerializeOptions.IgnoreNullValues = true);
7979

8080
services.TryAddSingleton<OAuth2TokenClient>();

WebApiClientCore.Extensions.OAuths/TokenProviders/OAuth2TokenClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sealed class OAuth2TokenClient
2626
public OAuth2TokenClient(IHttpClientFactory httpClientFactory, IOptionsMonitor<HttpApiOptions> httpApiOptionsMonitor)
2727
{
2828
this.httpClientFactory = httpClientFactory;
29-
this.httpApiOptions = httpApiOptionsMonitor.Get(nameof(OAuth2TokenClient));
29+
this.httpApiOptions = httpApiOptionsMonitor.Get(HttpApi.GetName(typeof(OAuth2TokenClient)));
3030
}
3131

3232
/// <summary>

0 commit comments

Comments
 (0)