IModelCustomizer.Customize(ModelBuilder, DbContext) Method

Definition

Builds the model for a given context.

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)

Parameters

modelBuilder
ModelBuilder

The builder being used to construct the model.

dbContextcontext
DbContext

The context instance that the model is being created for.

Remarks

If any instance data from context is used when building the model, then the implementation of Create(DbContext, Boolean) also needs to be updated to ensure the model is cached correctly.

Applies to