ServiceCollectionDescriptorExtensions
public static IServiceCollection Add(this IServiceCollection collection, ServiceDescriptor descriptor)
Adds the specified descriptor to the collection.
public static IServiceCollection Add(this IServiceCollection collection, IEnumerable<ServiceDescriptor> descriptors)
Adds a sequence of ServiceDescriptor to the collection.
public static IServiceCollection Replace(this IServiceCollection collection, ServiceDescriptor descriptor)
Removes the first service in IServiceCollection with the same service type
as descriptor and adds to the collection.
Adds the specified descriptor to the collection if the
service type hasn't been already registered.
public static void TryAdd(this IServiceCollection collection, IEnumerable<ServiceDescriptor> descriptors)
Adds the specified descriptors to the collection if the
service type hasn't been already registered.
Adds a ServiceDescriptor if an existing descriptor with the same
ServiceType and an implementation that does not already exist
in services...
public static void TryAddEnumerable(this IServiceCollection services, IEnumerable<ServiceDescriptor> descriptors)
Adds the specified ServiceDescriptors if an existing descriptor with the same
ServiceType and an implementation that does not already exist
in services...
public static void TryAddScoped(this IServiceCollection collection, Type service, Type implementationType)
public static void TryAddScoped(this IServiceCollection collection, Type service, Func<IServiceProvider, object> implementationFactory)
public static void TryAddScoped<TService, TImplementation>(this IServiceCollection collection) where TImplementation : TService
public static void TryAddScoped<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
public static void TryAddSingleton(this IServiceCollection collection, Type service, Type implementationType)
public static void TryAddSingleton(this IServiceCollection collection, Type service, Func<IServiceProvider, object> implementationFactory)
public static void TryAddSingleton<TService, TImplementation>(this IServiceCollection collection) where TImplementation : TService
public static void TryAddSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
public static void TryAddTransient(this IServiceCollection collection, Type service, Type implementationType)
public static void TryAddTransient(this IServiceCollection collection, Type service, Func<IServiceProvider, object> implementationFactory)
public static void TryAddTransient<TService, TImplementation>(this IServiceCollection collection) where TImplementation : TService
public static void TryAddTransient<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)