共用方式為


ServiceCollectionMap.TryAddSingletonEnumerable 方法

定義

多載

TryAddSingletonEnumerable(Type, Object)

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

TryAddSingletonEnumerable(Type, Type)

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

TryAddSingletonEnumerable<TService,TImplementation>()

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

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

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

TryAddSingletonEnumerable<TService>(TService)

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

TryAddSingletonEnumerable(Type, Object)

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

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddSingletonEnumerable (Type serviceType, object implementation);
abstract member TryAddSingletonEnumerable : Type * obj -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAddSingletonEnumerable : Type * obj -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAddSingletonEnumerable (serviceType As Type, implementation As Object) As ServiceCollectionMap

參數

serviceType
Type

服務的合約。

implementation
Object

實作服務的物件。

傳回

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

適用於

TryAddSingletonEnumerable(Type, Type)

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

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

參數

serviceType
Type

服務的合約。

implementationType
Type

實作服務的具體型別。

傳回

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

適用於

TryAddSingletonEnumerable<TService,TImplementation>()

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

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

類型參數

TService

服務的合約。

TImplementation

實作服務的具體型別。

傳回

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

適用於

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

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

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

類型參數

TService

服務的合約。

TImplementation

實作服務的具體型別。

參數

factory
Func<IServiceProvider,TImplementation>

實作此服務的處理站。

傳回

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

適用於

TryAddSingletonEnumerable<TService>(TService)

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

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

類型參數

TService

服務的合約。

參數

implementation
TService

實作服務的物件。

傳回

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

適用於