共用方式為


ConventionSetBuilder.Replace<TImplementation> 方法

定義

以衍生慣例取代現有的慣例。 此外,也會為現有慣例未實作的任何慣例類型註冊新的慣例。

public virtual void Replace<TImplementation> (Func<IServiceProvider,TImplementation> conventionFactory) where TImplementation : Microsoft.EntityFrameworkCore.Metadata.Conventions.IConvention;
abstract member Replace : Func<IServiceProvider, 'Implementation (requires 'Implementation :> Microsoft.EntityFrameworkCore.Metadata.Conventions.IConvention)> -> unit (requires 'Implementation :> Microsoft.EntityFrameworkCore.Metadata.Conventions.IConvention)
override this.Replace : Func<IServiceProvider, 'Implementation (requires 'Implementation :> Microsoft.EntityFrameworkCore.Metadata.Conventions.IConvention)> -> unit (requires 'Implementation :> Microsoft.EntityFrameworkCore.Metadata.Conventions.IConvention)
Public Overridable Sub Replace(Of TImplementation As IConvention) (conventionFactory As Func(Of IServiceProvider, TImplementation))

類型參數

TImplementation

舊慣例的類型。

參數

conventionFactory
Func<IServiceProvider,TImplementation>

建立新慣例的處理站。

適用於