ServiceCollectionDescriptorExtensions.RemoveAll 方法

定义

重载

RemoveAll(IServiceCollection, Type)

删除 IServiceCollection 中所有 serviceType 类型的服务。

RemoveAll<T>(IServiceCollection)

删除 IServiceCollection 中所有 T 类型的服务。

RemoveAll(IServiceCollection, Type)

Source:
ServiceCollectionDescriptorExtensions.cs
Source:
ServiceCollectionDescriptorExtensions.cs

删除 IServiceCollection 中所有 serviceType 类型的服务。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ RemoveAll(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ serviceType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection RemoveAll (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type serviceType);
static member RemoveAll : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function RemoveAll (collection As IServiceCollection, serviceType As Type) As IServiceCollection

参数

serviceType
Type

要删除的服务类型。

返回

用于链接的 IServiceCollection

适用于

RemoveAll<T>(IServiceCollection)

Source:
ServiceCollectionDescriptorExtensions.cs
Source:
ServiceCollectionDescriptorExtensions.cs

删除 IServiceCollection 中所有 T 类型的服务。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ RemoveAll(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection RemoveAll<T> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection);
static member RemoveAll : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function RemoveAll(Of T) (collection As IServiceCollection) As IServiceCollection

类型参数

T

参数

返回

用于链接的 IServiceCollection

适用于