Microsoft.Extensions.DependencyInjection.Abstractions by Microsoft

<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0-preview1-final" />

 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.

public static void TryAdd(this IServiceCollection collection, ServiceDescriptor descriptor)

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.

public static void TryAddEnumerable(this IServiceCollection services, ServiceDescriptor descriptor)

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)

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>(this IServiceCollection collection)

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)

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>(this IServiceCollection collection)

public static void TryAddSingleton<TService, TImplementation>(this IServiceCollection collection) where TImplementation : TService

public static void TryAddSingleton<TService>(this IServiceCollection collection, TService instance)

public static void TryAddSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)

public static void TryAddTransient(this IServiceCollection collection, Type service)

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>(this IServiceCollection collection)

public static void TryAddTransient<TService, TImplementation>(this IServiceCollection collection) where TImplementation : TService

public static void TryAddTransient<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)