HttpClientBuilderExtensions.RemoveAsKeyed(IHttpClientBuilder) 方法

定义

删除命名 HttpClientHttpMessageHandler的密钥注册。

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)的特定名称的客户端。

适用于