共用方式為


ServiceDescriptor 建構函式

定義

多載

ServiceDescriptor(Type, Object)

使用指定的 instance,將 ServiceDescriptor 的新執行個體初始化為 Singleton

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

使用指定的 ServiceDescriptor,初始化 factory 的新執行個體。

ServiceDescriptor(Type, Object, Object)

使用指定的 instance,將 ServiceDescriptor 的新執行個體初始化為 Singleton

ServiceDescriptor(Type, Type, ServiceLifetime)

使用指定的 ServiceDescriptor,初始化 implementationType 的新執行個體。

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

使用指定的 ServiceDescriptor,初始化 factory 的新執行個體。

ServiceDescriptor(Type, Object, Type, ServiceLifetime)

使用指定的 ServiceDescriptor,初始化 implementationType 的新執行個體。

ServiceDescriptor(Type, Object)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 instance,將 ServiceDescriptor 的新執行個體初始化為 Singleton

public:
 ServiceDescriptor(Type ^ serviceType, System::Object ^ instance);
public ServiceDescriptor (Type serviceType, object instance);
new Microsoft.Extensions.DependencyInjection.ServiceDescriptor : Type * obj -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Sub New (serviceType As Type, instance As Object)

參數

serviceType
Type

服務的 Type

instance
Object

執行服務的執行個體。

適用於

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

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 ServiceDescriptor,初始化 factory 的新執行個體。

public:
 ServiceDescriptor(Type ^ serviceType, Func<IServiceProvider ^, System::Object ^> ^ factory, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public ServiceDescriptor (Type serviceType, Func<IServiceProvider,object> factory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
new Microsoft.Extensions.DependencyInjection.ServiceDescriptor : Type * Func<IServiceProvider, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Sub New (serviceType As Type, factory As Func(Of IServiceProvider, Object), lifetime As ServiceLifetime)

參數

serviceType
Type

服務的 Type

factory
Func<IServiceProvider,Object>

用於建立服務執行個體的 Factory。

lifetime
ServiceLifetime

服務的 ServiceLifetime

適用於

ServiceDescriptor(Type, Object, Object)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 instance,將 ServiceDescriptor 的新執行個體初始化為 Singleton

public:
 ServiceDescriptor(Type ^ serviceType, System::Object ^ serviceKey, System::Object ^ instance);
public ServiceDescriptor (Type serviceType, object? serviceKey, object instance);
new Microsoft.Extensions.DependencyInjection.ServiceDescriptor : Type * obj * obj -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Sub New (serviceType As Type, serviceKey As Object, instance As Object)

參數

serviceType
Type

服務的 Type

serviceKey
Object

服務的 ServiceKey

instance
Object

執行服務的執行個體。

適用於

ServiceDescriptor(Type, Type, ServiceLifetime)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 ServiceDescriptor,初始化 implementationType 的新執行個體。

public:
 ServiceDescriptor(Type ^ serviceType, Type ^ implementationType, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public ServiceDescriptor (Type serviceType, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
new Microsoft.Extensions.DependencyInjection.ServiceDescriptor : Type * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Sub New (serviceType As Type, implementationType As Type, lifetime As ServiceLifetime)

參數

serviceType
Type

服務的 Type

implementationType
Type

實作服務的 Type

lifetime
ServiceLifetime

服務的 ServiceLifetime

適用於

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

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 ServiceDescriptor,初始化 factory 的新執行個體。

public:
 ServiceDescriptor(Type ^ serviceType, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, System::Object ^> ^ factory, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public ServiceDescriptor (Type serviceType, object? serviceKey, Func<IServiceProvider,object?,object> factory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
new Microsoft.Extensions.DependencyInjection.ServiceDescriptor : Type * obj * Func<IServiceProvider, obj, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Sub New (serviceType As Type, serviceKey As Object, factory As Func(Of IServiceProvider, Object, Object), lifetime As ServiceLifetime)

參數

serviceType
Type

服務的 Type

serviceKey
Object

服務的 ServiceKey

factory
Func<IServiceProvider,Object,Object>

用於建立服務執行個體的 Factory。

lifetime
ServiceLifetime

服務的 ServiceLifetime

適用於

ServiceDescriptor(Type, Object, Type, ServiceLifetime)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 ServiceDescriptor,初始化 implementationType 的新執行個體。

public:
 ServiceDescriptor(Type ^ serviceType, System::Object ^ serviceKey, Type ^ implementationType, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public ServiceDescriptor (Type serviceType, object? serviceKey, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
new Microsoft.Extensions.DependencyInjection.ServiceDescriptor : Type * obj * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Sub New (serviceType As Type, serviceKey As Object, implementationType As Type, lifetime As ServiceLifetime)

參數

serviceType
Type

服務的 Type

serviceKey
Object

服務的 ServiceKey

implementationType
Type

實作服務的 Type

lifetime
ServiceLifetime

服務的 ServiceLifetime

適用於