Method Remove
Remove(IServiceCollection, Type)
Removes all service descriptors of the specified serviceType from the services collection.
public static IServiceCollection Remove(this IServiceCollection services, Type serviceType)
Parameters
servicesIServiceCollectionThe IServiceCollection to remove service descriptors from.
serviceTypeTypeThe type of the service descriptors to remove.
Returns
- IServiceCollection
The modified IServiceCollection.
Remove<T>(IServiceCollection)
Removes all service descriptors of the specified type T from the services collection.
public static IServiceCollection Remove<T>(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe IServiceCollection to remove service descriptors from.
Returns
- IServiceCollection
The modified IServiceCollection.
Type Parameters
TThe type of the service descriptors to remove.