ServiceDescriptor 類別

定義

描述具有服務類型、實作和存留期的服務。Describes a service with its service type, implementation, and lifetime.

public ref class ServiceDescriptor
public class ServiceDescriptor
type ServiceDescriptor = class
Public Class ServiceDescriptor
繼承
ServiceDescriptor

建構函式

ServiceDescriptor(Type, Func<IServiceProvider,Object>, ServiceLifetime)

使用指定的 ServiceDescriptor,初始化 factory 的新執行個體。Initializes a new instance of ServiceDescriptor with the specified factory.

ServiceDescriptor(Type, Object)

使用指定的 instance,將 ServiceDescriptor 的新執行個體初始化為 SingletonInitializes a new instance of ServiceDescriptor with the specified instance as a Singleton.

ServiceDescriptor(Type, Type, ServiceLifetime)

使用指定的 ServiceDescriptor,初始化 implementationType 的新執行個體。Initializes a new instance of ServiceDescriptor with the specified implementationType.

屬性

ImplementationFactory
ImplementationInstance
ImplementationType
Lifetime
ServiceType

方法

Describe(Type, Func<IServiceProvider,Object>, ServiceLifetime)

使用指定的 serviceTypeimplementationFactorylifetime 來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified serviceType, implementationFactory, and lifetime.

Describe(Type, Type, ServiceLifetime)

使用指定的 serviceTypeimplementationTypelifetime 來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified serviceType, implementationType, and lifetime.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
Scoped(Type, Func<IServiceProvider,Object>)

使用指定的 serviceimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified service, implementationFactory, and the Scoped lifetime.

Scoped(Type, Type)

使用指定的 serviceimplementationTypeScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified service and implementationType and the Scoped lifetime.

Scoped<TService,TImplementation>()

使用指定的 TServiceTImplementationScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, TImplementation, and the Scoped lifetime.

Scoped<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

使用指定的 TServiceTImplementationimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, TImplementation, implementationFactory, and the Scoped lifetime.

Scoped<TService>(Func<IServiceProvider,TService>)

使用指定的 TServiceimplementationFactoryScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, implementationFactory, and the Scoped lifetime.

Singleton(Type, Func<IServiceProvider,Object>)

使用指定的 serviceTypeimplementationFactorySingleton 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified serviceType, implementationFactory, and the Singleton lifetime.

Singleton(Type, Object)

使用指定的 serviceTypeimplementationInstanceScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified serviceType, implementationInstance, and the Scoped lifetime.

Singleton(Type, Type)

使用指定的 serviceimplementationTypeSingleton 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified service and implementationType and the Singleton lifetime.

Singleton<TService,TImplementation>()

使用指定的 TServiceTImplementationSingleton 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, TImplementation, and the Singleton lifetime.

Singleton<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

使用指定的 TServiceTImplementationimplementationFactorySingleton 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, TImplementation, implementationFactory, and the Singleton lifetime.

Singleton<TService>(Func<IServiceProvider,TService>)

使用指定的 TServiceimplementationFactorySingleton 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, implementationFactory, and the Singleton lifetime.

Singleton<TService>(TService)

使用指定的 TServiceimplementationInstanceScoped 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, implementationInstance, and the Scoped lifetime.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
Transient(Type, Func<IServiceProvider,Object>)

使用指定的 serviceimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified service, implementationFactory, and the Transient lifetime.

Transient(Type, Type)

使用指定的 serviceimplementationTypeTransient 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified service and implementationType and the Transient lifetime.

Transient<TService,TImplementation>()

使用指定的 TServiceTImplementationTransient 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, TImplementation, and the Transient lifetime.

Transient<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

使用指定的 TServiceTImplementationimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, TImplementation, implementationFactory, and the Transient lifetime.

Transient<TService>(Func<IServiceProvider,TService>)

使用指定的 TServiceimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。Creates an instance of ServiceDescriptor with the specified TService, implementationFactory, and the Transient lifetime.

適用於