ModelCustomizer.Customize(ModelBuilder, DbContext) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
除了慣例所探索的內容之外,還會執行模型的其他組態。 此預設實作會藉由在內容上呼叫 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
要為其建立模型的內容實例。