ServiceCollectionDescriptorExtensions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Extension methods for adding and removing services to an IServiceCollection.
public ref class ServiceCollectionDescriptorExtensions abstract sealed
public static class ServiceCollectionDescriptorExtensions
type ServiceCollectionDescriptorExtensions = class
Public Module ServiceCollectionDescriptorExtensions
- Inheritance
-
ServiceCollectionDescriptorExtensions
Methods
Add(IServiceCollection, IEnumerable<ServiceDescriptor>) |
Adds a sequence of ServiceDescriptor to the |
Add(IServiceCollection, ServiceDescriptor) |
Adds the specified |
RemoveAll(IServiceCollection, Type) |
Removes all services of type |
RemoveAll<T>(IServiceCollection) |
Removes all services of type |
RemoveAllKeyed(IServiceCollection, Type, Object) |
Removes all services of type |
RemoveAllKeyed<T>(IServiceCollection, Object) |
Removes all services of type |
Replace(IServiceCollection, ServiceDescriptor) |
Removes the first service in IServiceCollection with the same service type
as |
TryAdd(IServiceCollection, IEnumerable<ServiceDescriptor>) |
Adds the specified |
TryAdd(IServiceCollection, ServiceDescriptor) |
Adds the specified |
TryAddEnumerable(IServiceCollection, IEnumerable<ServiceDescriptor>) |
Adds the specified ServiceDescriptors if an existing descriptor with the same
ServiceType and an implementation that does not already exist
in |
TryAddEnumerable(IServiceCollection, ServiceDescriptor) |
Adds a ServiceDescriptor if an existing descriptor with the same
ServiceType and an implementation that does not already exist in |
TryAddKeyedScoped(IServiceCollection, Type, Object) |
Adds the specified |
TryAddKeyedScoped(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>) |
Adds the specified |
TryAddKeyedScoped(IServiceCollection, Type, Object, Type) |
Adds the specified |
TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object) |
Adds the specified |
TryAddKeyedScoped<TService>(IServiceCollection, Object) |
Adds the specified |
TryAddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>) |
Adds the specified |
TryAddKeyedSingleton(IServiceCollection, Type, Object) |
Adds the specified |
TryAddKeyedSingleton(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>) |
Adds the specified |
TryAddKeyedSingleton(IServiceCollection, Type, Object, Type) |
Adds the specified |
TryAddKeyedSingleton<TService,TImplementation>(IServiceCollection, Object) |
Adds the specified |
TryAddKeyedSingleton<TService>(IServiceCollection, Object) |
Adds the specified |
TryAddKeyedSingleton<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>) |
Adds the specified |
TryAddKeyedSingleton<TService>(IServiceCollection, Object, TService) |
Adds the specified |
TryAddKeyedTransient(IServiceCollection, Type, Object) |
Adds the specified |
TryAddKeyedTransient(IServiceCollection, Type, Object, Func<IServiceProvider,Object,Object>) |
Adds the specified |
TryAddKeyedTransient(IServiceCollection, Type, Object, Type) |
Adds the specified |
TryAddKeyedTransient<TService,TImplementation>(IServiceCollection, Object) |
Adds the specified |
TryAddKeyedTransient<TService>(IServiceCollection, Object) |
Adds the specified |
TryAddKeyedTransient<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>) |
Adds the specified |
TryAddScoped(IServiceCollection, Type) |
Adds the specified |
TryAddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>) |
Adds the specified |
TryAddScoped(IServiceCollection, Type, Type) |
Adds the specified |
TryAddScoped<TService,TImplementation>(IServiceCollection) |
Adds the specified |
TryAddScoped<TService>(IServiceCollection) |
Adds the specified |
TryAddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
Adds the specified |
TryAddSingleton(IServiceCollection, Type) |
Adds the specified |
TryAddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>) |
Adds the specified |
TryAddSingleton(IServiceCollection, Type, Type) |
Adds the specified |
TryAddSingleton<TService,TImplementation>(IServiceCollection) |
Adds the specified |
TryAddSingleton<TService>(IServiceCollection) |
Adds the specified |
TryAddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
Adds the specified |
TryAddSingleton<TService>(IServiceCollection, TService) |
Adds the specified |
TryAddTransient(IServiceCollection, Type) |
Adds the specified |
TryAddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>) |
Adds the specified |
TryAddTransient(IServiceCollection, Type, Type) |
Adds the specified |
TryAddTransient<TService,TImplementation>(IServiceCollection) |
Adds the specified |
TryAddTransient<TService>(IServiceCollection) |
Adds the specified |
TryAddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
Adds the specified |
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for