共用方式為


ServiceCollectionMap.TryAddScopedEnumerable 方法

定義

多載

TryAddScopedEnumerable(Type, Type)

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

TryAddScopedEnumerable<TService,TImplementation>()

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

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

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

TryAddScopedEnumerable(Type, Type)

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

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

參數

serviceType
Type

服務的合約。

implementationType
Type

實作服務的具體型別。

傳回

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

適用於

TryAddScopedEnumerable<TService,TImplementation>()

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

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

類型參數

TService

服務的合約。

TImplementation

實作服務的具體型別。

傳回

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

適用於

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

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

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

類型參數

TService

服務的合約。

TImplementation

實作服務的具體型別。

參數

factory
Func<IServiceProvider,TImplementation>

實作此服務的處理站。

傳回

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

適用於