IModelCustomizer.Customize(ModelBuilder, DbContext) 方法

定义

为给定上下文生成模型。

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

参数

modelBuilder
ModelBuilder

用于构造模型的生成器。

dbContextcontext
DbContext

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

注解

如果在生成模型时使用了 来自 context 的任何实例数据,则还需要更新 的 Create(DbContext, Boolean) 实现以确保正确缓存模型。

适用于