CoreOptionsExtension.WithReplacedService 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| 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
具體的現有實施類型。
傳回
一個新實例,選項被更改。