ServiceDescriptor.DescribeKeyed 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime) |
创建具有指定 |
DescribeKeyed(Type, Object, Type, ServiceLifetime) |
创建具有指定 |
DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime)
- Source:
- ServiceDescriptor.cs
- Source:
- ServiceDescriptor.cs
- Source:
- ServiceDescriptor.cs
- Source:
- ServiceDescriptor.cs
创建具有指定 serviceType
、implementationFactory
和 lifetime
的 ServiceDescriptor 实例。
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
创建具有指定 serviceType
、implementationType
和 lifetime
的 ServiceDescriptor 实例。
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 的新实例。