HttpClientBuilderExtensions.RemoveAsKeyed(IHttpClientBuilder) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
拿掉具名 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
參數
- builder
- IHttpClientBuilder
傳回
可用來設定用戶端的 IHttpClientBuilder。
備註
如果與 ConfigureHttpClientDefaults(IServiceCollection, Action<IHttpClientBuilder>)搭配使用,它只會影響先前的「全域」AnyKey 註冊,而且不會影響使用 AddAsKeyed(IHttpClientBuilder, ServiceLifetime)註冊特定名稱的用戶端。