ServiceDescriptor
Describes a service with its service type, implementation, and lifetime.
Gets the factory used for creating service instances.
Gets the instance that implements the service.
Gets the Type that implements the service.
Indicates whether the service is a keyed service.
Gets the factory used for creating Keyed service instances.
Gets the instance that implements the service.
Gets the Type that implements the service.
Gets the ServiceLifetime of the service.
Get the key of the service, if applicable.
Gets the Type of the service.
Initializes a new instance of ServiceDescriptor with the specified implementationType.
public ServiceDescriptor(Type serviceType, object serviceKey, Type implementationType, ServiceLifetime lifetime)
Initializes a new instance of ServiceDescriptor with the specified implementationType.
public ServiceDescriptor(Type serviceType, Func<IServiceProvider, object> factory, ServiceLifetime lifetime)
Initializes a new instance of ServiceDescriptor with the specified factory.
public ServiceDescriptor(Type serviceType, object serviceKey, Func<IServiceProvider, object, object> factory, ServiceLifetime lifetime)
Initializes a new instance of ServiceDescriptor with the specified factory.
public static ServiceDescriptor Describe(Type serviceType, Type implementationType, ServiceLifetime lifetime)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationType,
and lifetime.
public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationFactory,
and lifetime.
public static ServiceDescriptor DescribeKeyed(Type serviceType, object serviceKey, Type implementationType, ServiceLifetime lifetime)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationType,
and lifetime.
public static ServiceDescriptor DescribeKeyed(Type serviceType, object serviceKey, Func<IServiceProvider, object, object> implementationFactory, ServiceLifetime lifetime)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationFactory,
and lifetime.
public static ServiceDescriptor KeyedScoped<TService, TImplementation>(object serviceKey) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
and the Scoped lifetime.
public static ServiceDescriptor KeyedScoped(Type service, object serviceKey, Type implementationType)
Creates an instance of ServiceDescriptor with the specified
service and implementationType
and the Scoped lifetime.
public static ServiceDescriptor KeyedScoped<TService, TImplementation>(object serviceKey, Func<IServiceProvider, object, TImplementation> implementationFactory) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
implementationFactory,
and the Scoped lifetime.
public static ServiceDescriptor KeyedScoped<TService>(object serviceKey, Func<IServiceProvider, object, TService> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
TService, implementationFactory,
and the Scoped lifetime.
public static ServiceDescriptor KeyedScoped(Type service, object serviceKey, Func<IServiceProvider, object, object> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
service, implementationFactory,
and the Scoped lifetime.
public static ServiceDescriptor KeyedSingleton<TService, TImplementation>(object serviceKey) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
and the Singleton lifetime.
public static ServiceDescriptor KeyedSingleton(Type service, object serviceKey, Type implementationType)
Creates an instance of ServiceDescriptor with the specified
service and implementationType
and the Singleton lifetime.
public static ServiceDescriptor KeyedSingleton<TService, TImplementation>(object serviceKey, Func<IServiceProvider, object, TImplementation> implementationFactory) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
implementationFactory,
and the Singleton lifetime.
public static ServiceDescriptor KeyedSingleton<TService>(object serviceKey, Func<IServiceProvider, object, TService> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
TService, implementationFactory,
and the Singleton lifetime.
public static ServiceDescriptor KeyedSingleton(Type serviceType, object serviceKey, Func<IServiceProvider, object, object> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationFactory,
and the Singleton lifetime.
public static ServiceDescriptor KeyedSingleton<TService>(object serviceKey, TService implementationInstance)
Creates an instance of ServiceDescriptor with the specified
TService, implementationInstance,
and the Singleton lifetime.
public static ServiceDescriptor KeyedSingleton(Type serviceType, object serviceKey, object implementationInstance)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationInstance,
and the Singleton lifetime.
public static ServiceDescriptor KeyedTransient<TService, TImplementation>(object serviceKey) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
and the Transient lifetime.
public static ServiceDescriptor KeyedTransient(Type service, object serviceKey, Type implementationType)
Creates an instance of ServiceDescriptor with the specified
service and implementationType
and the Transient lifetime.
public static ServiceDescriptor KeyedTransient<TService, TImplementation>(object serviceKey, Func<IServiceProvider, object, TImplementation> implementationFactory) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
implementationFactory,
and the Transient lifetime.
public static ServiceDescriptor KeyedTransient<TService>(object serviceKey, Func<IServiceProvider, object, TService> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
TService, implementationFactory,
and the Transient lifetime.
public static ServiceDescriptor KeyedTransient(Type service, object serviceKey, Func<IServiceProvider, object, object> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
service, implementationFactory,
and the Transient lifetime.
public static ServiceDescriptor Scoped<TService, TImplementation>() where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
and the Scoped lifetime.
Creates an instance of ServiceDescriptor with the specified
service and implementationType
and the Scoped lifetime.
public static ServiceDescriptor Scoped<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
implementationFactory,
and the Scoped lifetime.
public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
TService, implementationFactory,
and the Scoped lifetime.
public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
service, implementationFactory,
and the Scoped lifetime.
public static ServiceDescriptor Singleton<TService, TImplementation>() where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
and the Singleton lifetime.
Creates an instance of ServiceDescriptor with the specified
service and implementationType
and the Singleton lifetime.
public static ServiceDescriptor Singleton<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
implementationFactory,
and the Singleton lifetime.
public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
TService, implementationFactory,
and the Singleton lifetime.
public static ServiceDescriptor Singleton(Type serviceType, Func<IServiceProvider, object> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationFactory,
and the Singleton lifetime.
Creates an instance of ServiceDescriptor with the specified
TService, implementationInstance,
and the Singleton lifetime.
Creates an instance of ServiceDescriptor with the specified
serviceType, implementationInstance,
and the Singleton lifetime.
public static ServiceDescriptor Transient<TService, TImplementation>() where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
and the Transient lifetime.
Creates an instance of ServiceDescriptor with the specified
service and implementationType
and the Transient lifetime.
public static ServiceDescriptor Transient<TService, TImplementation>(Func<IServiceProvider, TImplementation> implementationFactory) where TImplementation : TService
Creates an instance of ServiceDescriptor with the specified
TService, TImplementation,
implementationFactory,
and the Transient lifetime.
public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
TService, implementationFactory,
and the Transient lifetime.
public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory)
Creates an instance of ServiceDescriptor with the specified
service, implementationFactory,
and the Transient lifetime.