IConventionModelBuilder Interface

Definition

Provides a simple API surface for configuring an IConventionModelBuilder from conventions.

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

public interface IConventionModelBuilder : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionAnnotatableBuilder
type IConventionModelBuilder = interface
    interface IConventionAnnotatableBuilder
Public Interface IConventionModelBuilder
Implements IConventionAnnotatableBuilder
Implements

Properties

Metadata

Gets the model being configured.

ModelBuilder

Gets the model builder.

(Inherited from IConventionAnnotatableBuilder)

Methods

CanIgnore(String, Boolean)

Returns a value indicating whether the given entity type name can be ignored from the current configuration source

CanIgnore(Type, Boolean)

Returns a value indicating whether the given entity type can be ignored from the current configuration source

CanRemoveAnnotation(String, Boolean)

Returns a value indicating whether an annotation with the given name can be removed using this configuration source.

(Inherited from IConventionAnnotatableBuilder)
CanSetAnnotation(String, Object, Boolean)

Returns a value indicating whether an annotation with the given name and value can be set from this configuration source.

(Inherited from IConventionAnnotatableBuilder)
CanSetChangeTrackingStrategy(Nullable<ChangeTrackingStrategy>, Boolean)

Returns a value indicating whether the given change tracking strategy can be set from the current configuration source

CanSetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)

Returns a value indicating whether the given property access mode can be set from the current configuration source

Entity(String, Nullable<Boolean>, Boolean)

Returns an object that can be used to configure a given entity type in the model. If an entity type with the provided name is not already part of the model, a new shadow entity type will be added to the model.

Entity(String, String, IConventionEntityType, Boolean)

Returns an object that can be used to configure a given entity type with defining navigation. If an entity type with the provided name is not already part of the model, a new shadow entity type will be added to the model.

Entity(Type, Nullable<Boolean>, Boolean)

Returns an object that can be used to configure a given entity type in the model. If an entity type with the provided type is not already part of the model, a new entity type will be added to the model.

Entity(Type, String, IConventionEntityType, Boolean)

Returns an object that can be used to configure a given entity type with defining navigation. If an entity type with the provided type is not already part of the model, a new entity type will be added to the model.

HasAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists with same or lower ConfigurationSource.

(Inherited from IConventionAnnotatableBuilder)
HasChangeTrackingStrategy(Nullable<ChangeTrackingStrategy>, Boolean)

Configures the default ChangeTrackingStrategy to be used for this model. This strategy indicates how the context detects changes to properties for an instance of an entity type.

HasNoAnnotation(String, Boolean)

Removes the annotation with the given name from this object.

(Inherited from IConventionAnnotatableBuilder)
HasNoEntityType(IConventionEntityType, Boolean)

Removes the given entity type from the model.

HasNonNullAnnotation(String, Object, Boolean)

Sets the annotation stored under the given name. Overwrites the existing annotation if an annotation with the specified name already exists with same or lower ConfigurationSource. Removes the annotation if null value is specified.

(Inherited from IConventionAnnotatableBuilder)
Ignore(String, Boolean)

Excludes the given entity type name from the model and prevents it from being added by convention.

Ignore(Type, Boolean)

Excludes the given entity type from the model and prevents it from being added by convention.

IsIgnored(String, Boolean)

Indicates whether the given entity type name is ignored for the current configuration source.

IsIgnored(Type, Boolean)

Indicates whether the given entity type name is ignored for the current configuration source.

Owned(Type, Boolean)

Marks an entity type as owned. All references to this type will be configured as separate owned type instances.

RemoveAnnotation(String, Boolean)
Obsolete.

Removes the annotation with the given name from this object.

(Inherited from IConventionAnnotatableBuilder)
SetOrRemoveAnnotation(String, Object, Boolean)
Obsolete.

Sets or removes the annotation stored under the given name.

(Inherited from IConventionAnnotatableBuilder)
SharedTypeEntity(String, Type, Nullable<Boolean>, Boolean)

Returns an object that can be used to configure a given shared type entity type in the model.

If an entity type with the provided name is not already part of the model, a new entity type with provided CLR type will be added to the model as shared type entity type.

Shared type entity type is an entity type which can share CLR type with other types in the model but has a unique name and always identified by the name.

UsePropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)

Sets the PropertyAccessMode to use for all properties of this entity type.

By default, the backing field, if one is found by convention or has been specified, is used when new objects are constructed, typically when entities are queried from the database. Properties are used for all other accesses. Calling this method will change that behavior for all properties in the model as described in the PropertyAccessMode enum.

Extension Methods

CanSetDefaultContainer(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given container name can be set as default.

HasDefaultContainer(IConventionModelBuilder, String, Boolean)

Configures the default container name that will be used if no name is explicitly configured for an entity type.

CanSetCollation(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given collation can be set as default.

CanSetDefaultSchema(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given schema can be set as default.

CanSetMaxIdentifierLength(IConventionModelBuilder, Nullable<Int32>, Boolean)

Returns a value indicating whether the maximum length allowed for store identifiers can be set.

HasDbFunction(IConventionModelBuilder, MethodInfo, Boolean)

Configures a relational database function.

HasDbFunction(IConventionModelBuilder, String, Type, Boolean)

Configures a relational database function.

HasDefaultSchema(IConventionModelBuilder, String, Boolean)

Configures the default schema that database objects should be created in, if no schema is explicitly configured.

HasMaxIdentifierLength(IConventionModelBuilder, Nullable<Int32>, Boolean)

Configures the maximum length allowed for store identifiers.

HasSequence(IConventionModelBuilder, String, String, Boolean)

Configures a database sequence when targeting a relational database.

UseCollation(IConventionModelBuilder, String, Boolean)

Configures the database collation, which will be used by all columns without an explicit collation.

CanSetDatabaseMaxSize(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given value can be set as the maximum size of the database.

CanSetHiLoSequence(IConventionModelBuilder, String, String, Boolean)

Returns a value indicating whether the given name and schema can be set for the hi-lo sequence.

CanSetIdentityColumnIncrement(IConventionModelBuilder, Nullable<Int32>, Boolean)

Returns a value indicating whether the given value can be set as the default increment for SQL Server IDENTITY.

CanSetIdentityColumnSeed(IConventionModelBuilder, Nullable<Int32>, Boolean)

Returns a value indicating whether the given value can be set as the default seed for SQL Server IDENTITY.

CanSetPerformanceLevelSql(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given value can be set as the performance level of the database.

CanSetServiceTierSql(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given value can be set as the service tier of the database.

CanSetValueGenerationStrategy(IConventionModelBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

Returns a value indicating whether the given value can be set as the default value generation strategy.

ForSqlServerHasHiLoSequence(IConventionModelBuilder, String, String, Boolean)
Obsolete.

Configures the database sequence used for the hi-lo pattern to generate values for key properties marked as OnAdd, when targeting SQL Server.

ForSqlServerHasIdentityIncrement(IConventionModelBuilder, Nullable<Int32>, Boolean)
Obsolete.

Configures the default increment for SQL Server IDENTITY.

ForSqlServerHasIdentitySeed(IConventionModelBuilder, Nullable<Int32>, Boolean)
Obsolete.

Configures the default seed for SQL Server IDENTITY.

ForSqlServerHasValueGenerationStrategy(IConventionModelBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)
Obsolete.

Configures the default value generation strategy for key properties marked as OnAdd, when targeting SQL Server.

HasDatabaseMaxSize(IConventionModelBuilder, String, Boolean)

Attempts to configure the maximum size for Azure SQL Database.

Units must be included, e.g. "100 MB". See Azure SQL Database documentation for all supported values.

HasHiLoSequence(IConventionModelBuilder, String, String, Boolean)

Configures the database sequence used for the hi-lo pattern to generate values for key properties marked as OnAdd, when targeting SQL Server.

HasIdentityColumnIncrement(IConventionModelBuilder, Nullable<Int32>, Boolean)

Configures the default increment for SQL Server IDENTITY.

HasIdentityColumnSeed(IConventionModelBuilder, Nullable<Int32>, Boolean)

Configures the default seed for SQL Server IDENTITY.

HasPerformanceLevelSql(IConventionModelBuilder, String, Boolean)

Attempts to configure the performance level (SERVICE_OBJECTIVE) for Azure SQL Database.

See Azure SQL Database documentation for supported values.

HasServiceTierSql(IConventionModelBuilder, String, Boolean)

Attempts to configure the service tier (EDITION) for Azure SQL Database.

See Azure SQL Database documentation for supported values.

HasValueGenerationStrategy(IConventionModelBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

Configures the default value generation strategy for key properties marked as OnAdd, when targeting SQL Server.

Applies to