共用方式為


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

要為其建立模型的內容實例。

實作

適用於