Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ServiceDescriptor Class
Definition
- Namespace:
- Microsoft.Extensions.DependencyInjection
- Assembly:
- Microsoft.Extensions.DependencyInjection.Abstractions.dll
- Package:
- Microsoft.Extensions.DependencyInjection.Abstractions v11.0.0-preview.5.26302.115
- Source:
- ServiceDescriptor.cs
- Source:
- ServiceDescriptor.cs
- Source:
- ServiceDescriptor.cs
- Source:
- ServiceDescriptor.cs
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Describes a service with its service type, implementation, and lifetime.
public ref class ServiceDescriptor
public class ServiceDescriptor
type ServiceDescriptor = class
Public Class ServiceDescriptor
- Inheritance
-
ServiceDescriptor
Constructors
| Name | Description |
|---|---|
| ServiceDescriptor(Type, Func<IServiceProvider,Object>, ServiceLifetime) |
Initializes a new instance of ServiceDescriptor with the specified |
| ServiceDescriptor(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime) |
Initializes a new instance of ServiceDescriptor with the specified |
| ServiceDescriptor(Type, Object, Object) |
Initializes a new instance of ServiceDescriptor with the specified |
| ServiceDescriptor(Type, Object, Type, ServiceLifetime) |
Initializes a new instance of ServiceDescriptor with the specified |
| ServiceDescriptor(Type, Object) |
Initializes a new instance of ServiceDescriptor with the specified |
| ServiceDescriptor(Type, Type, ServiceLifetime) |
Initializes a new instance of ServiceDescriptor with the specified |
Properties
| Name | Description |
|---|---|
| ImplementationFactory |
Gets the factory used for creating service instance,
or returns |
| ImplementationInstance |
Gets the instance that implements the service,
or returns |
| ImplementationType |
Gets the Type that implements the service,
or returns |
| IsKeyedService |
Indicates whether the service is a keyed service. |
| KeyedImplementationFactory |
Gets the factory used for creating Keyed service instances,
or throws InvalidOperationException if IsKeyedService is |
| KeyedImplementationInstance |
Gets the instance that implements the service,
or throws InvalidOperationException if IsKeyedService is |
| KeyedImplementationType |
Gets the Type that implements the service,
or throws InvalidOperationException if IsKeyedService is |
| Lifetime |
Gets the ServiceLifetime of the service. |
| ServiceKey |
Get the key of the service, if applicable. |
| ServiceType |
Gets the Type of the service. |
Methods
| Name | Description |
|---|---|
| Describe(Type, Func<IServiceProvider,Object>, ServiceLifetime) |
Creates an instance of ServiceDescriptor with the specified
|
| Describe(Type, Type, ServiceLifetime) |
Creates an instance of ServiceDescriptor with the specified
|
| DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime) |
Creates an instance of ServiceDescriptor with the specified
|
| DescribeKeyed(Type, Object, Type, ServiceLifetime) |
Creates an instance of ServiceDescriptor with the specified
|
| Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
| GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
| GetType() |
Gets the Type of the current instance. (Inherited from Object) |
| KeyedScoped(Type, Object, Func<IServiceProvider,Object,Object>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedScoped(Type, Object, Type) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedScoped<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedScoped<TService,TImplementation>(Object) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedScoped<TService>(Object, Func<IServiceProvider,Object,TService>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton(Type, Object, Func<IServiceProvider,Object,Object>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton(Type, Object, Object) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton(Type, Object, Type) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton<TService,TImplementation>(Object) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton<TService>(Object, Func<IServiceProvider,Object,TService>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedSingleton<TService>(Object, TService) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedTransient(Type, Object, Func<IServiceProvider,Object,Object>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedTransient(Type, Object, Type) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedTransient<TService,TImplementation>(Object, Func<IServiceProvider,Object,TImplementation>) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedTransient<TService,TImplementation>(Object) |
Creates an instance of ServiceDescriptor with the specified
|
| KeyedTransient<TService>(Object, Func<IServiceProvider,Object,TService>) |
Creates an instance of ServiceDescriptor with the specified
|
| MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
| Scoped(Type, Func<IServiceProvider,Object>) |
Creates an instance of ServiceDescriptor with the specified
|
| Scoped(Type, Type) |
Creates an instance of ServiceDescriptor with the specified
|
| Scoped<TService,TImplementation>() |
Creates an instance of ServiceDescriptor with the specified
|
| Scoped<TService,TImplementation>(Func<IServiceProvider,TImplementation>) |
Creates an instance of ServiceDescriptor with the specified
|
| Scoped<TService>(Func<IServiceProvider,TService>) |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton(Type, Func<IServiceProvider,Object>) |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton(Type, Object) |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton(Type, Type) |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton<TService,TImplementation>() |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton<TService,TImplementation>(Func<IServiceProvider,TImplementation>) |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton<TService>(Func<IServiceProvider,TService>) |
Creates an instance of ServiceDescriptor with the specified
|
| Singleton<TService>(TService) |
Creates an instance of ServiceDescriptor with the specified
|
| ToString() |
Returns a string that represents the current object. |
| Transient(Type, Func<IServiceProvider,Object>) |
Creates an instance of ServiceDescriptor with the specified
|
| Transient(Type, Type) |
Creates an instance of ServiceDescriptor with the specified
|
| Transient<TService,TImplementation>() |
Creates an instance of ServiceDescriptor with the specified
|
| Transient<TService,TImplementation>(Func<IServiceProvider,TImplementation>) |
Creates an instance of ServiceDescriptor with the specified
|
| Transient<TService>(Func<IServiceProvider,TService>) |
Creates an instance of ServiceDescriptor with the specified
|
Applies to
Feedback
Was this page helpful?
