Microsoft.Extensions.DependencyInjection.Abstractions by Microsoft.Extensions.DependencyInjection.Abstractions

<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.0.1" />

 ServiceDescriptor

public class ServiceDescriptor
public Func<IServiceProvider, object> ImplementationFactory { get; }

public object ImplementationInstance { get; }

public Type ImplementationType { get; }

public ServiceLifetime Lifetime { get; }

public Type ServiceType { get; }

public ServiceDescriptor(Type serviceType, Type implementationType, ServiceLifetime lifetime)

Initializes a new instance of ServiceDescriptor with the specified implementationType.

public ServiceDescriptor(Type serviceType, object instance)

Initializes a new instance of ServiceDescriptor with the specified instance as a Singleton.

public ServiceDescriptor(Type serviceType, Func<IServiceProvider, object> factory, ServiceLifetime lifetime)

Initializes a new instance of ServiceDescriptor with the specified factory.

public static ServiceDescriptor Describe(Type serviceType, Type implementationType, ServiceLifetime lifetime)

public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)

public static ServiceDescriptor Scoped<TService, TImplementation>() where TImplementation : TService

public static ServiceDescriptor Scoped(Type service, Type implementationType)

public static ServiceDescriptor Scoped<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TImplementation : TService

public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory)

public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory)

public static ServiceDescriptor Singleton<TService, TImplementation>() where TImplementation : TService

public static ServiceDescriptor Singleton(Type service, Type implementationType)

public static ServiceDescriptor Singleton<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TImplementation : TService

public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory)

public static ServiceDescriptor Singleton(Type serviceType, Func<IServiceProvider, object> implementationFactory)

public static ServiceDescriptor Singleton<TService>(TService implementationInstance)

public static ServiceDescriptor Singleton(Type serviceType, object implementationInstance)

public static ServiceDescriptor Transient<TService, TImplementation>() where TImplementation : TService

public static ServiceDescriptor Transient(Type service, Type implementationType)

public static ServiceDescriptor Transient<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TImplementation : TService

public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory)

public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory)