Bagikan melalui


CoreOptionsExtension.WithReplacedService Metode

Definisi

Overload

WithReplacedService(Type, Type)

Membuat instans baru dengan semua opsi yang sama seperti untuk instans ini, tetapi dengan opsi yang diberikan berubah. Tidak biasa untuk memanggil metode ini secara langsung. Alih-alih gunakan DbContextOptionsBuilder.

WithReplacedService(Type, Type, Type)

Membuat instans baru dengan semua opsi yang sama seperti untuk instans ini, tetapi dengan opsi yang diberikan berubah. Tidak biasa untuk memanggil metode ini secara langsung. Alih-alih gunakan DbContextOptionsBuilder.

WithReplacedService(Type, Type)

Membuat instans baru dengan semua opsi yang sama seperti untuk instans ini, tetapi dengan opsi yang diberikan berubah. Tidak biasa untuk memanggil metode ini secara langsung. Alih-alih gunakan 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

Parameter

serviceType
Type

Kontrak layanan.

implementationType
Type

Jenis implementasi yang digunakan untuk layanan.

Mengembalikan

Instans baru dengan opsi berubah.

Berlaku untuk

WithReplacedService(Type, Type, Type)

Membuat instans baru dengan semua opsi yang sama seperti untuk instans ini, tetapi dengan opsi yang diberikan berubah. Tidak biasa untuk memanggil metode ini secara langsung. Alih-alih gunakan 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

Parameter

serviceType
Type

Kontrak layanan.

newImplementationType
Type

Jenis implementasi yang digunakan untuk layanan.

currentImplementationType
Type

Jenis implementasi tertentu yang ada untuk diganti.

Mengembalikan

Instans baru dengan opsi berubah.

Berlaku untuk