共用方式為


HttpClientBuilderExtensions.RemoveAsKeyed(IHttpClientBuilder) 方法

定義

拿掉具名 HttpClient 的索引鍵註冊,並 HttpMessageHandler

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ RemoveAsKeyed(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder RemoveAsKeyed (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder);
static member RemoveAsKeyed : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function RemoveAsKeyed (builder As IHttpClientBuilder) As IHttpClientBuilder

參數

傳回

可用來設定用戶端的 IHttpClientBuilder

備註

如果與 ConfigureHttpClientDefaults(IServiceCollection, Action<IHttpClientBuilder>)搭配使用,它只會影響先前的「全域」AnyKey 註冊,而且不會影響使用 AddAsKeyed(IHttpClientBuilder, ServiceLifetime)註冊特定名稱的用戶端。

適用於