共用方式為


CoreOptionsExtension.WithReplacedService 方法

定義

多載

WithReplacedService(Type, Type)

建立與這個實例相同的所有選項的新實例,但指定選項已變更。 直接呼叫這個方法並不尋常。 請改用 DbContextOptionsBuilder

WithReplacedService(Type, Type, Type)

建立與這個實例相同的所有選項的新實例,但指定選項已變更。 直接呼叫這個方法並不尋常。 請改用 DbContextOptionsBuilder

WithReplacedService(Type, Type)

建立與這個實例相同的所有選項的新實例,但指定選項已變更。 直接呼叫這個方法並不尋常。 請改用 DbContextOptionsBuilder

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

參數

serviceType
Type

服務合約。

implementationType
Type

要用於服務的實作類型。

傳回

選項已變更的新實例。

適用於

WithReplacedService(Type, Type, Type)

建立與這個實例相同的所有選項的新實例,但指定選項已變更。 直接呼叫這個方法並不尋常。 請改用 DbContextOptionsBuilder

public virtual Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension WithReplacedService (Type serviceType, Type newImplementationType, Type currentImplementationType = default);
public virtual Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension WithReplacedService (Type serviceType, Type newImplementationType, Type? currentImplementationType = default);
abstract member WithReplacedService : Type * Type * Type -> Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension
override this.WithReplacedService : Type * Type * Type -> Microsoft.EntityFrameworkCore.Infrastructure.CoreOptionsExtension
Public Overridable Function WithReplacedService (serviceType As Type, newImplementationType As Type, Optional currentImplementationType As Type = Nothing) As CoreOptionsExtension

參數

serviceType
Type

服務合約。

newImplementationType
Type

要用於服務的實作類型。

currentImplementationType
Type

要取代的特定現有實作類型。

傳回

選項已變更的新實例。

適用於