IModelCustomizer IModelCustomizer Interface

Definition

Performs additional configuration of the model in addition to what is discovered by convention.

This interface is typically used by database providers (and other extensions). It is generally not used in application code.

public interface IModelCustomizer
Public Interface IModelCustomizer

Methods

Customize(ModelBuilder, DbContext) Customize(ModelBuilder, DbContext)

Builds the model for a given context.

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

void Customize(ModelBuilder modelBuilder, DbContext dbContext)
Sub Customize(modelBuilder As ModelBuilder, dbContext As DbContext)
Parameters
modelBuilder
ModelBuilder ModelBuilder

The builder being used to construct the model.

dbContext
DbContext DbContext

The context instance that the model is being created for.