Than being chained after a call to Entity(). Of the model, it will be added to the model. Performs configuration of a given entity type in the model. If the entity type is not already part of the model, it will be added to the model. This allows additionalĬonfiguration at the model level to be chained after configuration for the entity type. Than being chained after a call to Entity(String). This overload allows configuration of the entity type to be done in line in the method call rather If an entity type with the provided name is not already part of the model,Ī new entity type that does not have a corresponding CLR type will be added to the model. Returns an object that can be used to configure a given entity type in the model. Instances that are defined in provided assembly.
You should only use it directly in your code with extreme caution and knowing thatĭoing so can result in application failures when updating to a new Entity Framework Core release.Īpplies configuration that is defined in an IQueryTypeConfiguration instance.Īppl圜onfigurationsFromAssembly(Assembly, Func)Īpplies configuration from all IEntityTypeConfiguration /> It may be changed or removed without notice inĪny release. The same compatibility standards as public APIs. This is an internal API that supports the Entity Framework Core infrastructure and not subject to ModelBuilder(ConventionSet, ModelDependencies, ModelConfiguration) ModelBuilder(ConventionSet, ModelDependencies) Initializes a new instance of the ModelBuilder class that will Warning: conventions are needed to build a correct model.
Initializes a new instance of the ModelBuilder class with no conventions. See Modeling entity types and relationships in EF Core for more information. Implements IInfrastructure(Of IConventionModelBuilder) Inheritance Implements IInfrastructure(Of InternalModelBuilder) Public Class ModelBuilder Interface IInfrastructure Public Class ModelBuilder Interface IInfrastructure type ModelBuilder = class In this article public class ModelBuilder : public class ModelBuilder : type ModelBuilder = class Model externally and set it on a DbContextOptions instance that is passed to the context constructor. OnModelCreating(ModelBuilder) on your derived context. You can use ModelBuilder to construct a model for a context by overriding Provides a simple API surface for configuring a IMutableModel that defines the shape of yourĮntities, the relationships between them, and how they map to the database.