共用方式為


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) 實作,以確保正確快取模型。

適用於