ServiceDescriptor.Transient 方法

定義

多載

Transient(Type, Func<IServiceProvider,Object>)

使用指定的 serviceimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。

Transient(Type, Type)

使用指定的 serviceimplementationTypeTransient 存留期來建立 ServiceDescriptor 的執行個體。

Transient<TService,TImplementation>()

使用指定的 TServiceTImplementationTransient 存留期來建立 ServiceDescriptor 的執行個體。

Transient<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

使用指定的 TServiceTImplementationimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。

Transient<TService>(Func<IServiceProvider,TService>)

使用指定的 TServiceimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。

Transient(Type, Func<IServiceProvider,Object>)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 serviceimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Transient(Type ^ service, Func<IServiceProvider ^, System::Object ^> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Transient (Type service, Func<IServiceProvider,object> implementationFactory);
static member Transient : Type * Func<IServiceProvider, obj> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function Transient (service As Type, implementationFactory As Func(Of IServiceProvider, Object)) As ServiceDescriptor

參數

service
Type

服務的類型。

implementationFactory
Func<IServiceProvider,Object>

建立服務實作之新執行個體的 Factory。

傳回

ServiceDescriptor 的新執行個體。

適用於

Transient(Type, Type)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 serviceimplementationTypeTransient 存留期來建立 ServiceDescriptor 的執行個體。

public:
 static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Transient(Type ^ service, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Transient (Type service, Type implementationType);
static member Transient : Type * Type -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor
Public Shared Function Transient (service As Type, implementationType As Type) As ServiceDescriptor

參數

service
Type

服務的類型。

implementationType
Type

實作的類型。

傳回

ServiceDescriptor 的新執行個體。

適用於

Transient<TService,TImplementation>()

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 TServiceTImplementationTransient 存留期來建立 ServiceDescriptor 的執行個體。

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Transient();
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Transient<TService,TImplementation> () where TService : class where TImplementation : class, TService;
static member Transient : unit -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Transient(Of TService As Class, TImplementation As Class) () As ServiceDescriptor

類型參數

TService

服務的類型。

TImplementation

實作的類型。

傳回

ServiceDescriptor 的新執行個體。

適用於

Transient<TService,TImplementation>(Func<IServiceProvider,TImplementation>)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 TServiceTImplementationimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Transient(Func<IServiceProvider ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Transient<TService,TImplementation> (Func<IServiceProvider,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member Transient : Func<IServiceProvider, #'Service> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Transient(Of TService As Class, TImplementation As Class) (implementationFactory As Func(Of IServiceProvider, TImplementation)) As ServiceDescriptor

類型參數

TService

服務的類型。

TImplementation

實作的類型。

參數

implementationFactory
Func<IServiceProvider,TImplementation>

建立服務實作之新執行個體的 Factory。

傳回

ServiceDescriptor 的新執行個體。

適用於

Transient<TService>(Func<IServiceProvider,TService>)

來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs
來源:
ServiceDescriptor.cs

使用指定的 TServiceimplementationFactoryTransient 存留期來建立 ServiceDescriptor 的執行個體。

public:
generic <typename TService>
 where TService : class static Microsoft::Extensions::DependencyInjection::ServiceDescriptor ^ Transient(Func<IServiceProvider ^, TService> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.ServiceDescriptor Transient<TService> (Func<IServiceProvider,TService> implementationFactory) where TService : class;
static member Transient : Func<IServiceProvider, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.ServiceDescriptor (requires 'Service : null)
Public Shared Function Transient(Of TService As Class) (implementationFactory As Func(Of IServiceProvider, TService)) As ServiceDescriptor

類型參數

TService

服務的類型。

參數

implementationFactory
Func<IServiceProvider,TService>

建立服務實作之新執行個體的 Factory。

傳回

ServiceDescriptor 的新執行個體。

適用於