Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​DependencyInjection.​ServiceDescriptor
Assembly: Microsoft.Extensions.DependencyInjection.Abstractions
Inheritance: object → ServiceDescriptor
Describes a service with its service type, implementation, and lifetime.
Properties
public
System.​Func<​System.​IServiceProvider, object>
ImplementationFactory
Gets the factory used for creating service instance,
or returns <see langword="null" /> if <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="true" /> .
Remarks If <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="true" /> , <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.KeyedImplementationFactory" /> should be called instead.
public
object
ImplementationInstance
Gets the instance that implements the service,
or returns <see langword="null" /> if <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="true" /> .
Remarks If <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="true" /> , <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.KeyedImplementationInstance" /> should be called instead.
public
System.​Type
ImplementationType
Gets the <see cref="T:System.Type" /> that implements the service,
or returns <see langword="null" /> if <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="true" /> .
Remarks If <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="true" /> , <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.KeyedImplementationType" /> should be called instead.
public
bool
IsKeyedService
Indicates whether the service is a keyed service.
public
System.​Func<​System.​IServiceProvider, object, object>
KeyedImplementationFactory
Gets the factory used for creating Keyed service instances,
or throws <see cref="T:System.InvalidOperationException" /> if <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="false" /> .
Remarks If <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="false" /> , <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationFactory" /> should be called instead.
public
object
KeyedImplementationInstance
Gets the instance that implements the service,
or throws <see cref="T:System.InvalidOperationException" /> if <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="false" /> .
Remarks If <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="false" /> , <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationInstance" /> should be called instead.
public
System.​Type
KeyedImplementationType
Gets the <see cref="T:System.Type" /> that implements the service,
or throws <see cref="T:System.InvalidOperationException" /> if <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="false" /> .
Remarks If <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.IsKeyedService" /> is <see langword="false" /> , <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ImplementationType" /> should be called instead.
public
ServiceLifetime
Lifetime
Gets the <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceLifetime" /> of the service.
public
object
ServiceKey
Get the key of the service, if applicable.
public
System.​Type
ServiceType
Gets the <see cref="T:System.Type" /> of the service.
Methods
public static
ServiceDescriptor
Describe​(System.​Type serviceType,
System.​Func<​System.​IServiceProvider, object> implementationFactory,
ServiceLifetime lifetime)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationFactory" /> ,
and <paramref name="lifetime" /> .
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
implementationFactory
A factory to create new instances of the service implementation.
lifetime
The lifetime of the service.
public static
ServiceDescriptor
Describe​(System.​Type serviceType,
System.​Type implementationType,
ServiceLifetime lifetime)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationType" /> ,
and <paramref name="lifetime" /> .
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
implementationType
The type of the implementation.
lifetime
The lifetime of the service.
public static
ServiceDescriptor
DescribeKeyed​(System.​Type serviceType,
object serviceKey,
System.​Func<​System.​IServiceProvider, object, object> implementationFactory,
ServiceLifetime lifetime)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationFactory" /> ,
and <paramref name="lifetime" /> .
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
lifetime
The lifetime of the service.
public static
ServiceDescriptor
DescribeKeyed​(System.​Type serviceType,
object serviceKey,
System.​Type implementationType,
ServiceLifetime lifetime)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationType" /> ,
and <paramref name="lifetime" /> .
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationType
The type of the implementation.
lifetime
The lifetime of the service.
public static
ServiceDescriptor
KeyedScoped​(System.​Type service,
object serviceKey,
System.​Func<​System.​IServiceProvider, object, object> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedScoped​(System.​Type service,
object serviceKey,
System.​Type implementationType)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> and <paramref name="implementationType" />
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationType
The type of the implementation.
public static
ServiceDescriptor
KeyedScoped​(object serviceKey,
System.​Func<​System.​IServiceProvider, object, TService> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedScoped​(object serviceKey)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
public static
ServiceDescriptor
KeyedScoped​(object serviceKey,
System.​Func<​System.​IServiceProvider, object, TImplementation> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
<paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedSingleton​(System.​Type serviceType,
object serviceKey,
System.​Func<​System.​IServiceProvider, object, object> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedSingleton​(System.​Type serviceType,
object serviceKey,
object implementationInstance)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationInstance" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationInstance
The instance of the implementation.
public static
ServiceDescriptor
KeyedSingleton​(System.​Type service,
object serviceKey,
System.​Type implementationType)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> and <paramref name="implementationType" />
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationType
The type of the implementation.
public static
ServiceDescriptor
KeyedSingleton​(object serviceKey,
System.​Func<​System.​IServiceProvider, object, TService> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedSingleton​(object serviceKey,
TService implementationInstance)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationInstance" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationInstance
The instance of the implementation.
public static
ServiceDescriptor
KeyedSingleton​(object serviceKey)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
public static
ServiceDescriptor
KeyedSingleton​(object serviceKey,
System.​Func<​System.​IServiceProvider, object, TImplementation> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
<paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedTransient​(System.​Type service,
object serviceKey,
System.​Func<​System.​IServiceProvider, object, object> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedTransient​(System.​Type service,
object serviceKey,
System.​Type implementationType)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> and <paramref name="implementationType" />
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationType
The type of the implementation.
public static
ServiceDescriptor
KeyedTransient​(object serviceKey,
System.​Func<​System.​IServiceProvider, object, TService> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
KeyedTransient​(object serviceKey)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
public static
ServiceDescriptor
KeyedTransient​(object serviceKey,
System.​Func<​System.​IServiceProvider, object, TImplementation> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
<paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceKey
The <see cref="P:Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ServiceKey" /> of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Scoped​(System.​Type service,
System.​Func<​System.​IServiceProvider, object> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Scoped​(System.​Type service,
System.​Type implementationType)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> and <paramref name="implementationType" />
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
implementationType
The type of the implementation.
public static
ServiceDescriptor
Scoped​(System.​Func<​System.​IServiceProvider, TService> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Scoped​()
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
public static
ServiceDescriptor
Scoped​(System.​Func<​System.​IServiceProvider, TImplementation> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
<paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Scoped" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Singleton​(System.​Type serviceType,
System.​Func<​System.​IServiceProvider, object> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Singleton​(System.​Type serviceType,
object implementationInstance)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="serviceType" /> , <paramref name="implementationInstance" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
serviceType
The type of the service.
implementationInstance
The instance of the implementation.
public static
ServiceDescriptor
Singleton​(System.​Type service,
System.​Type implementationType)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> and <paramref name="implementationType" />
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
implementationType
The type of the implementation.
public static
ServiceDescriptor
Singleton​(System.​Func<​System.​IServiceProvider, TService> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Singleton​(TService implementationInstance)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationInstance" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationInstance
The instance of the implementation.
public static
ServiceDescriptor
Singleton​()
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
public static
ServiceDescriptor
Singleton​(System.​Func<​System.​IServiceProvider, TImplementation> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
<paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationFactory
A factory to create new instances of the service implementation.
public
string
ToString​()
public static
ServiceDescriptor
Transient​(System.​Type service,
System.​Func<​System.​IServiceProvider, object> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Transient​(System.​Type service,
System.​Type implementationType)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<paramref name="service" /> and <paramref name="implementationType" />
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
service
The type of the service.
implementationType
The type of the implementation.
public static
ServiceDescriptor
Transient​(System.​Func<​System.​IServiceProvider, TService> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationFactory
A factory to create new instances of the service implementation.
public static
ServiceDescriptor
Transient​()
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
public static
ServiceDescriptor
Transient​(System.​Func<​System.​IServiceProvider, TImplementation> implementationFactory)
Creates an instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> with the specified
<typeparamref name="TService" /> , <typeparamref name="TImplementation" /> ,
<paramref name="implementationFactory" /> ,
and the <see cref="F:Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient" /> lifetime.
Returns A new instance of <see cref="T:Microsoft.Extensions.DependencyInjection.ServiceDescriptor" /> .
implementationFactory
A factory to create new instances of the service implementation.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object