ServiceDescriptor.DescribeKeyed 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime) |
使用指定的 |
DescribeKeyed(Type, Object, Type, ServiceLifetime) |
使用指定的 |
DescribeKeyed(Type, Object, Func<IServiceProvider,Object,Object>, ServiceLifetime)
使用指定的 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>
建立服務實作之新執行個體的 Factory。
- lifetime
- ServiceLifetime
服務的存留期。
傳回
ServiceDescriptor 的新執行個體。
適用於
DescribeKeyed(Type, Object, Type, ServiceLifetime)
使用指定的 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 的新執行個體。