ServiceDescriptor.Describe 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Describe(Type, Func<IServiceProvider,Object>, ServiceLifetime) |
使用指定的 |
Describe(Type, Type, ServiceLifetime) |
使用指定的 |
Describe(Type, Func<IServiceProvider,Object>, ServiceLifetime)
使用指定的 serviceType
、implementationFactory
和 lifetime
來建立 ServiceDescriptor 的執行個體。
public:
static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Describe(Type ^ serviceType, Func<IServiceProvider ^, System::Object ^> ^ implementationFactory, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Describe (Type serviceType, Func<IServiceProvider,object> implementationFactory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
static member Describe : Type * Func<IServiceProvider, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function Describe (serviceType As Type, implementationFactory As Func(Of IServiceProvider, Object), lifetime As ServiceLifetime) As ServiceDescriptor
參數
- serviceType
- Type
服務的類型。
- implementationFactory
- Func<IServiceProvider,Object>
建立服務實作之新執行個體的 Factory。
- lifetime
- ServiceLifetime
服務的存留期。
傳回
ServiceDescriptor 的新執行個體。
適用於
Describe(Type, Type, ServiceLifetime)
使用指定的 serviceType
、implementationType
和 lifetime
來建立 ServiceDescriptor 的執行個體。
public:
static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Describe(Type ^ serviceType, Type ^ implementationType, Microsoft::Extensions::DependencyInjection::ServiceLifetime lifetime);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Describe (Type serviceType, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
static member Describe : Type * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function Describe (serviceType As Type, implementationType As Type, lifetime As ServiceLifetime) As ServiceDescriptor
參數
- serviceType
- Type
服務的類型。
- implementationType
- Type
實作的類型。
- lifetime
- ServiceLifetime
服務的存留期。
傳回
ServiceDescriptor 的新執行個體。