語言

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>

創造新約定的工廠。

適用於