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>

创建新约定的工厂。

适用于