ServiceDescriptor.DescribeKeyed 方法

定义

重载

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

创建具有指定 serviceTypeimplementationFactorylifetimeServiceDescriptor 实例。

DescribeKeyed(Type, Object, Type, ServiceLifetime)

创建具有指定 serviceTypeimplementationTypelifetimeServiceDescriptor 实例。

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

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

创建具有指定 serviceTypeimplementationFactorylifetimeServiceDescriptor 实例。

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ DescribeKeyed(Type ^ serviceType, System::Object ^ serviceKey, Func<IServiceProvider ^, System::Object ^, System::Object ^> ^ implementationFactory, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor DescribeKeyed (Type serviceType, object? serviceKey, Func<IServiceProvider,object?,object> implementationFactory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
static member DescribeKeyed : Type * obj * Func<IServiceProvider, obj, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function DescribeKeyed (serviceType As Type, serviceKey As Object, implementationFactory As Func(Of IServiceProvider, Object, Object), lifetime As ServiceLifetime) As ServiceDescriptor

参数

serviceType
Type

服务的类型。

serviceKey
Object

服务的 ServiceKey

implementationFactory
Func<IServiceProvider,Object,Object>

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

lifetime
ServiceLifetime

服务的生存期。

返回

ServiceDescriptor 的新实例。

适用于

DescribeKeyed(Type, Object, Type, ServiceLifetime)

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

创建具有指定 serviceTypeimplementationTypelifetimeServiceDescriptor 实例。

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ DescribeKeyed(Type ^ serviceType, System::Object ^ serviceKey, Type ^ implementationType, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor DescribeKeyed (Type serviceType, object? serviceKey, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
static member DescribeKeyed : Type * obj * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function DescribeKeyed (serviceType As Type, serviceKey As Object, implementationType As Type, lifetime As ServiceLifetime) As ServiceDescriptor

参数

serviceType
Type

服务的类型。

serviceKey
Object

服务的 ServiceKey

implementationType
Type

实现的类型。

lifetime
ServiceLifetime

服务的生存期。

返回

ServiceDescriptor 的新实例。

适用于