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