DbContext.ConfigureConventions(ModelConfigurationBuilder) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Override this method to set defaults and configure conventions before they run. This method is invoked before OnModelCreating(ModelBuilder).
protected internal virtual void ConfigureConventions (Microsoft.EntityFrameworkCore.ModelConfigurationBuilder configurationBuilder);
abstract member ConfigureConventions : Microsoft.EntityFrameworkCore.ModelConfigurationBuilder -> unit
override this.ConfigureConventions : Microsoft.EntityFrameworkCore.ModelConfigurationBuilder -> unit
Protected Friend Overridable Sub ConfigureConventions (configurationBuilder As ModelConfigurationBuilder)
Parameters
- configurationBuilder
- ModelConfigurationBuilder
The builder being used to set defaults and configure conventions that will be used to build the model for this context.
Remarks
If a model is explicitly set on the options for this context (via UseModel(IModel)) then this method will not be run. However, it will still run when creating a compiled model.
See Pre-convention model building in EF Core for more information and examples.