ModelCustomizer.Customize(ModelBuilder, DbContext) 方法

定义

除了按约定发现的内容外,还执行模型的其他配置。 此默认实现通过在上下文上调用 OnModelCreating(ModelBuilder) 来为给定上下文生成模型。

public virtual void Customize (Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, Microsoft.EntityFrameworkCore.DbContext dbContext);
public virtual void Customize (Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, Microsoft.EntityFrameworkCore.DbContext context);
abstract member Customize : Microsoft.EntityFrameworkCore.ModelBuilder * Microsoft.EntityFrameworkCore.DbContext -> unit
override this.Customize : Microsoft.EntityFrameworkCore.ModelBuilder * Microsoft.EntityFrameworkCore.DbContext -> unit
abstract member Customize : Microsoft.EntityFrameworkCore.ModelBuilder * Microsoft.EntityFrameworkCore.DbContext -> unit
override this.Customize : Microsoft.EntityFrameworkCore.ModelBuilder * Microsoft.EntityFrameworkCore.DbContext -> unit
Public Overridable Sub Customize (modelBuilder As ModelBuilder, dbContext As DbContext)
Public Overridable Sub Customize (modelBuilder As ModelBuilder, context As DbContext)

参数

modelBuilder
ModelBuilder

用于构造模型的生成器。

dbContextcontext
DbContext

要为其创建模型的上下文实例。

实现

适用于