ServiceDescriptor.Describe 方法

定义

重载

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

创建具有指定 serviceTypeimplementationFactorylifetimeServiceDescriptor 实例。

Describe(Type, Type, ServiceLifetime)

创建具有指定 serviceTypeimplementationTypelifetimeServiceDescriptor 实例。

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

Source:
ServiceDescriptor.cs
Source:
ServiceDescriptor.cs

创建具有指定 serviceTypeimplementationFactorylifetimeServiceDescriptor 实例。

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

创建具有指定 serviceTypeimplementationTypelifetimeServiceDescriptor 实例。

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 的新实例。

适用于