語言

ServiceCollectionMap.TryAddSingletonEnumerable 方法

定義

多載

名稱 Description
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)

來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs

將 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)

來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs

將 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>()

來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs

將 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>)

來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs

將 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)

來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs
來源:
ServiceCollectionMap.cs

將 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

實作服務的物件。

傳回

映射,使得後續呼叫可以串連起來。

適用於