ServiceDescriptor 构造函数

定义

重载

ServiceDescriptor(Type, Object)

使用指定的 instance 作为 Singleton 来初始化 ServiceDescriptor 的新实例。

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

用指定的 ServiceDescriptor 初始化 factory 的新实例。

ServiceDescriptor(Type, Object, Object)

使用指定的 instance 作为 Singleton 来初始化 ServiceDescriptor 的新实例。

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)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs

使用指定的 instance 作为 Singleton 来初始化 ServiceDescriptor 的新实例。

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)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
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>

用于创建服务实例的工厂。

lifetime
ServiceLifetime

服务的 ServiceLifetime

适用于

ServiceDescriptor(Type, Object, Object)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs

使用指定的 instance 作为 Singleton 来初始化 ServiceDescriptor 的新实例。

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)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
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)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
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>

用于创建服务实例的工厂。

lifetime
ServiceLifetime

服务的 ServiceLifetime

适用于

ServiceDescriptor(Type, Object, Type, ServiceLifetime)

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs
Source:
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

适用于