語言

ServiceDescriptor.Transient 方法

定義

多載

名稱 Description
Transient(Type, Func<IServiceProvider,Object>)

建立一個具有指定 、 implementationFactory、 及壽命的Transient實例ServiceDescriptor。service

Transient(Type, Type)

建立一個帶有指定 和 的實例ServiceDescriptor,且 壽命為 Transient 。implementationTypeservice

Transient<TService,TImplementation>()

建立一個具有指定 、 TImplementation、 及壽命的Transient實例ServiceDescriptor。TService

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

建立一個具有指定 、 、 implementationFactory、 及Transient壽命的實例ServiceDescriptor。 TImplementationTService

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

建立一個具有指定 、 implementationFactory、 及壽命的Transient實例ServiceDescriptor。TService

Transient(Type, Func<IServiceProvider,Object>)

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

建立一個具有指定 、 implementationFactory、 及壽命的Transient實例ServiceDescriptor。service

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>

一個工廠,用來建立服務實作的新實例。

傳回

一個新的實例。ServiceDescriptor

適用於

Transient(Type, Type)

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

建立一個帶有指定 和 的實例ServiceDescriptor,且 壽命為 Transient 。implementationTypeservice

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

建立一個具有指定 、 TImplementation、 及壽命的Transient實例ServiceDescriptor。TService

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

建立一個具有指定 、 、 implementationFactory、 及Transient壽命的實例ServiceDescriptor。 TImplementationTService

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>

一個工廠,用來建立服務實作的新實例。

傳回

一個新的實例。ServiceDescriptor

適用於

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

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

建立一個具有指定 、 implementationFactory、 及壽命的Transient實例ServiceDescriptor。TService

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>

一個工廠,用來建立服務實作的新實例。

傳回

一個新的實例。ServiceDescriptor

適用於