共用方式為


ServiceCollectionMap.TryAddTransientEnumerable 方法

定義

多載

TryAddTransientEnumerable(Type, Type)

Transient將指定具體型別所實作的服務加入至實作指定合約的服務清單。 只有在集合不包含相同服務和實作類型的其他註冊時,才會新增服務。

TryAddTransientEnumerable<TService,TImplementation>()

Transient將指定具體型別所實作的服務加入至實作指定合約的服務清單。 只有在集合不包含相同服務和實作類型的其他註冊時,才會新增服務。

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

Transient將指定處理站所實作的服務新增至實作指定合約的服務清單。 只有在集合不包含相同服務和實作類型的其他註冊時,才會新增服務。

TryAddTransientEnumerable(Type, Type)

Transient將指定具體型別所實作的服務加入至實作指定合約的服務清單。 只有在集合不包含相同服務和實作類型的其他註冊時,才會新增服務。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddTransientEnumerable (Type serviceType, Type implementationType);
abstract member TryAddTransientEnumerable : Type * Type -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAddTransientEnumerable : Type * Type -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAddTransientEnumerable (serviceType As Type, implementationType As Type) As ServiceCollectionMap

參數

serviceType
Type

服務的合約。

implementationType
Type

實作服務的具體型別。

傳回

地圖,讓進一步的呼叫可以鏈結。

適用於

TryAddTransientEnumerable<TService,TImplementation>()

Transient將指定具體型別所實作的服務加入至實作指定合約的服務清單。 只有在集合不包含相同服務和實作類型的其他註冊時,才會新增服務。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddTransientEnumerable<TService,TImplementation> () where TService : class where TImplementation : class, TService;
abstract member TryAddTransientEnumerable : unit -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddTransientEnumerable : unit -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddTransientEnumerable(Of TService As Class, TImplementation As Class) () As ServiceCollectionMap

類型參數

TService

服務的合約。

TImplementation

實作服務的具體型別。

傳回

地圖,讓進一步的呼叫可以鏈結。

適用於

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

Transient將指定處理站所實作的服務新增至實作指定合約的服務清單。 只有在集合不包含相同服務和實作類型的其他註冊時,才會新增服務。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddTransientEnumerable<TService,TImplementation> (Func<IServiceProvider,TImplementation> factory) where TService : class where TImplementation : class, TService;
abstract member TryAddTransientEnumerable : Func<IServiceProvider, #'Service> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddTransientEnumerable : Func<IServiceProvider, #'Service> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddTransientEnumerable(Of TService As Class, TImplementation As Class) (factory As Func(Of IServiceProvider, TImplementation)) As ServiceCollectionMap

類型參數

TService

服務的合約。

TImplementation

實作服務的具體型別。

參數

factory
Func<IServiceProvider,TImplementation>

實作此服務的處理站。

傳回

地圖,讓進一步的呼叫可以鏈結。

適用於