Microsoft.EntityFrameworkCore.Metadata.Conventions Namespace

Classes

BackingFieldAttributeConvention

A convention that configures a property as having a backing field based on the BackingFieldAttribute attribute.

BackingFieldConvention

A convention that finds backing fields for properties based on their names: * <[property name]>k__BackingField * _[camel-cased property name] * _[property name] * m_[camel-cased property name] * m_[property name]

The field type must be of a type that's assignable to or from the property type. If more than one matching field is found an exception is thrown.

BaseTypeDiscoveryConvention

A convention that finds base and derived entity types that are already part of the model based on the associated CLR type hierarchy.

CascadeDeleteConvention

A convention that sets the delete behavior to Cascade for required foreign keys and ClientSetNull for optional ones.

ChangeTrackingStrategyConvention

A convention that sets a flag on the model to always skip detecting changes if no entity type is using the Snapshot strategy.

ConcurrencyCheckAttributeConvention

A convention that configures a property as a concurrency token if it has the ConcurrencyCheckAttribute.

ConstructorBindingConvention

A convention that binds entity type constructor parameters to existing properties and service properties based on their names:

  • [parameter name]
  • [pascal-cased parameter name]
  • _[parameter name]
  • _[pascal-cased parameter name]
  • m_[parameter name]
  • m_[pascal-cased parameter name]
ContextContainerConvention

A convention that configures the default container name as the context type name.

ConventionSet

Represents a set of conventions used to build a model.

CosmosDiscriminatorConvention

A convention that configures the discriminator value for entity types as the entity type name.

CosmosKeyDiscoveryConvention

A convention that finds primary key property for the entity type based on the names and adds the partition key to it if present.

DatabaseGeneratedAttributeConvention

A convention that configures a property as OnAdd if Identity is specified, OnAddOrUpdate if Computed is specified or Never if None is specified using a DatabaseGeneratedAttribute.

DbFunctionTypeMappingConvention

A convention configure type mapping for IDbFunction instances.

DbSetFindingConvention

A convention that adds entity types based on the DbSet<TEntity> properties defined on the derived DbContext class.

DefiningQueryRewritingConvention

Convention that converts accesses of DbSet<TEntity> inside query filters and defining queries into QueryRootExpression. This makes them consistent with how DbSet accesses in the actual queries are represented, which allows for easier processing in the query pipeline.

DerivedTypeDiscoveryConvention

A convention that finds derived entity types that are already part of the model based on the associated CLR type hierarchy.

DiscriminatorConvention

A convention that configures the discriminator value for entity types in a hierarchy as the entity type name.

EntityTypeAttributeConventionBase<TAttribute>

A base type for conventions that perform configuration based on an attribute specified on an entity type.

EntityTypeHierarchyMappingConvention

A convention that removes discriminators from non-TPH entity types and unmaps the inherited properties for TPT entity types.

ForeignKeyAttributeConvention

A convention that configures the foreign key properties associated with a navigation property based on the ForeignKeyAttribute specified on the properties or the navigation properties.

For one-to-one relationships the attribute has to be specified on the navigation property pointing to the principal.

ForeignKeyIndexConvention

A convention that creates indexes on foreign key properties unless they are already covered by existing indexes or keys.

ForeignKeyPropertyDiscoveryConvention

A convention that finds foreign key properties for relationships based on their names, ignoring case: * [navigation property name][principal key property name] * [navigation property name]Id * [principal entity name][principal key property name] * [principal entity name]Id

If no matching properties were found, the relationship doesn't represent an ownership, the dependent side is not ambiguous and not derived then if the relationship is one-to-one, the primary key properties are used, otherwise the convention tries to match properties with the exact name as principal key properties if they are a proper subset of the dependent PK.

If a match was found, but the property types are not compatible with the principal key types no further matches are searched for.

If the relationship uses shadow properties created by convention they are recreated to remove suffixes used to make the names unique.

IndexAttributeConvention

A convention that configures database indexes based on the IndexAttribute.

InheritanceDiscoveryConventionBase

Base type for inheritance discovery conventions

InversePropertyAttributeConvention

A convention that configures the inverse navigation property based on the InversePropertyAttribute specified on the other navigation property.

KeyAttributeConvention

A convention that configures the entity type key based on the KeyAttribute specified on a property.

KeyDiscoveryConvention

A convention that finds primary key property for the entity type based on the names, ignoring case: * Id * [entity name]Id

If the entity type is owned through a reference navigation property then the corresponding foreign key properties are used.

If the entity type is owned through a collection navigation property then a composite primary key is configured using the foreign key properties with an extra property that matches the naming convention above.

KeylessEntityTypeAttributeConvention

A convention that ignores entity types that have the KeylessAttribute.

ManyToManyJoinEntityTypeConvention

A convention which looks for matching skip navigations and automatically creates a many-to-many join entity with suitable foreign keys, sets the two matching skip navigations to use those foreign keys.

MaxLengthAttributeConvention

A convention that configures the maximum length based on the MaxLengthAttribute applied on the property.

ModelCleanupConvention

A convention that removes any state that is only used during model building.

NavigationAttributeConventionBase<TAttribute>

A base type for conventions that perform configuration based on an attribute applied to a navigation.

NavigationBackingFieldAttributeConvention

A convention that configures a navigation property as having a backing field based on the BackingFieldAttribute attribute.

NavigationEagerLoadingConvention

A convention that configures the navigations to owned entity types as eager loaded.

NonNullableConventionBase

A base type for conventions that configure model aspects based on whether the member type is a non-nullable reference type.

NonNullableNavigationConvention

A convention that configures the non-nullable navigations to principal entity type as required.

NonNullableReferencePropertyConvention

A convention that configures the properties of non-nullable types as required.

NotMappedEntityTypeAttributeConvention

A convention that ignores entity types that have the NotMappedAttribute.

NotMappedMemberAttributeConvention

A convention that ignores members on entity types that have the NotMappedAttribute.

OwnedEntityTypeAttributeConvention

A convention that configures the entity types that have the OwnedAttribute as owned.

OwnedTypesConvention

A convention that configures owned entity types with defining navigation as owned entity types without defining navigation if there's only one navigation of this type.

PropertyAttributeConventionBase<TAttribute>

A base type for conventions that perform configuration based on an attribute applied to a property.

PropertyDiscoveryConvention

A convention that adds properties to entity types corresponding to scalar public properties on the CLR type.

QueryFilterDefiningQueryRewritingConvention

Convention that converts accesses of DbSets inside query filters and defining queries into EntityQueryables. This makes them consistent with how DbSet accesses in the actual queries are represented, which allows for easier processing in the query pipeline.

QueryFilterDefiningQueryRewritingConvention.DbSetAccessRewritingExpressionVisitor
QueryFilterRewritingConvention

Convention that converts accesses of DbSet<TEntity> inside query filters into QueryRootExpression. This makes them consistent with how DbSet accesses in the actual queries are represented, which allows for easier processing in the query pipeline.

QueryFilterRewritingConvention.DbSetAccessRewritingExpressionVisitor

A visitor that rewrites DbSet accesses encountered in an expression to QueryRootExpression.

RelationalColumnAttributeConvention

A convention that configures column name and type for a property based on the applied ColumnAttribute.

RelationalColumnCommentAttributeConvention

A convention that configures the column comment for a property or field based on the applied CommentAttribute.

RelationalDbFunctionAttributeConvention

A convention that configures model function mappings based on public static methods on the context marked with DbFunctionAttribute.

RelationalMaxIdentifierLengthConvention

A convention that configures the maximum object identifier length supported by the database.

RelationalModelConvention

A convention that precomputes a relational model.

RelationalQueryFilterDefiningQueryRewritingConvention
RelationalQueryFilterDefiningQueryRewritingConvention.RelationalDbSetAccessRewritingExpressionVisitor
RelationalQueryFilterRewritingConvention
RelationalQueryFilterRewritingConvention.RelationalDbSetAccessRewritingExpressionVisitor
RelationalTableAttributeConvention

A convention that configures the table name and schema for entity types based on the applied TableAttribute.

RelationalTableCommentAttributeConvention

A convention that configures the table comment for an entity type based on the applied CommentAttribute.

RelationalValueGenerationConvention

A convention that configures store value generation as OnAdd on properties that are part of the primary key and not part of any foreign keys or were configured to have a database default value. It also configures properties as OnAddOrUpdate if they were configured as computed columns.

RelationshipDiscoveryConvention

A convention that configures relationships between entity types based on the navigation properties as long as there is no ambiguity as to which is the corresponding inverse navigation.

RequiredNavigationAttributeConvention

A convention that configures the principal side of the relationship as required if the RequiredAttribute is applied on the navigation property to the principal entity type.

RequiredPropertyAttributeConvention

A convention that configures properties as required if they have the RequiredAttribute applied.

SequenceUniquificationConvention

A convention which ensures that all sequences in the model have unique names within a schema when truncated to the maximum identifier length for the model.

ServicePropertyDiscoveryConvention

A convention that adds service properties to entity types.

SharedTableConvention

A convention that manipulates names of database objects for entity types that share a table to avoid clashes.

SqliteConventionSetBuilder

A builder for building conventions for SQLite.

The service lifetime is Scoped and multiple registrations are allowed. This means that each DbContext instance will use its own set of instances of this service. The implementations may depend on other services registered with any lifetime. The implementations do not need to be thread-safe.

SqlServerConventionSetBuilder

A builder for building conventions for SQL Server.

The service lifetime is Scoped and multiple registrations are allowed. This means that each DbContext instance will use its own set of instances of this service. The implementations may depend on other services registered with any lifetime. The implementations do not need to be thread-safe.

SqlServerDbFunctionConvention

A convention that ensures that Schema is populated for database functions which have IsBuiltIn flag set to false.

SqlServerIndexConvention

A convention that configures the filter for unique non-clustered indexes with nullable columns to filter out null values.

SqlServerMemoryOptimizedTablesConvention

A convention that configures indexes as non-clustered for memory-optimized tables.

SqlServerOnDeleteConvention

A convention that configures the OnDelete behavior for foreign keys on the join entity type for self-referencing skip navigations

SqlServerSharedTableConvention

A convention that manipulates names of database objects for entity types that share a table to avoid clashes.

SqlServerStoreGenerationConvention

A convention that ensures that properties aren't configured to have a default value, as computed column or using a SqlServerValueGenerationStrategy at the same time.

SqlServerValueGenerationConvention

A convention that configures store value generation as OnAdd on properties that are part of the primary key and not part of any foreign keys, were configured to have a database default value or were configured to use a SqlServerValueGenerationStrategy. It also configures properties as OnAddOrUpdate if they were configured as computed columns.

SqlServerValueGenerationStrategyConvention

A convention that configures the default model SqlServerValueGenerationStrategy as IdentityColumn.

StoreGenerationConvention

A convention that ensures that properties aren't configured to have a default value and as computed column at the same time.

StoreKeyConvention

A convention that adds the 'id' property - a key required by Azure Cosmos.

This convention also adds the '__jObject' containing the JSON object returned by the store.

StringLengthAttributeConvention

A convention that configures the maximum length based on the StringLengthAttribute applied on the property.

TableNameFromDbSetConvention

A convention that configures the table name based on the DbSet<TEntity> property name.

TableSharingConcurrencyTokenConvention

A convention that finds entity types which share a table which has a concurrency token column where those entity types do not have a property mapped to that column. It then creates a shadow concurrency property mapped to that column on the base-most entity type(s).

TableValuedDbFunctionConvention

A convention that configures the entity type to which a queryable function is mapped.

TimestampAttributeConvention

A convention that configures the property as a concurrency token if a TimestampAttribute is applied to it.

TypeMappingConvention

A convention that creates and assigns store type mapping to entity properties.

ValidatingConvention

A convention that checks whether the model is valid.

ValueGenerationConvention

A convention that configures store value generation as OnAdd on properties that are part of the primary key and not part of any foreign keys.

Interfaces

IConvention

This is the base interface for all convention interfaces, it should not be implemented directly.

IConventionBatch

Represents an object that delays any convention invocations until it is run or disposed.

IConventionContext

Contextual information associated with each convention call.

IConventionContext<TMetadata>

Contextual information associated with each convention call.

IEntityTypeAddedConvention

Represents an operation that should be performed when an entity type is added to the model.

IEntityTypeAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on an entity type.

IEntityTypeBaseTypeChangedConvention

Represents an operation that should be performed when the base type of an entity type changes.

IEntityTypeIgnoredConvention

Represents an operation that should be performed when an entity type is ignored.

IEntityTypeMemberIgnoredConvention

Represents an operation that should be performed when an entity type member is ignored.

IEntityTypePrimaryKeyChangedConvention

Represents an operation that should be performed when the primary key for an entity type is changed.

IEntityTypeRemovedConvention

Represents an operation that should be performed when an entity type is removed from the model.

IForeignKeyAddedConvention

Represents an operation that should be performed when a foreign key is added to the entity type.

IForeignKeyAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on a foreign key.

IForeignKeyDependentRequirednessChangedConvention

Represents an operation that should be performed when the dependent requiredness for a foreign key is changed.

IForeignKeyOwnershipChangedConvention

Represents an operation that should be performed when the ownership value for a foreign key is changed.

IForeignKeyPrincipalEndChangedConvention

Represents an operation that should be performed when the principal end of a foreign key is changed.

IForeignKeyPropertiesChangedConvention

Represents an operation that should be performed when the foreign key properties or principal key are changed.

IForeignKeyRemovedConvention

Represents an operation that should be performed when a foreign key is removed.

IForeignKeyRequirednessChangedConvention

Represents an operation that should be performed when the requiredness for a foreign key is changed.

IForeignKeyUniquenessChangedConvention

Represents an operation that should be performed when the uniqueness for a foreign key is changed.

IIndexAddedConvention

Represents an operation that should be performed when an index is added to the entity type.

IIndexAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on an index.

IIndexRemovedConvention

Represents an operation that should be performed when an index is removed from the entity type.

IIndexUniquenessChangedConvention

Represents an operation that should be performed when the uniqueness for an index is changed.

IKeyAddedConvention

Represents an operation that should be performed when a key is added to the entity type.

IKeyAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on a key.

IKeyRemovedConvention

Represents an operation that should be performed when a key is removed.

IModelAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on a model.

IModelFinalizedConvention

Represents an operation that should be performed after a model is finalized and can no longer be mutated.

IModelFinalizingConvention

Represents an operation that should be performed when a model is being finalized.

IModelInitializedConvention

Represents an operation that should be performed when a model is initialized.

INavigationAddedConvention

Represents an operation that should be performed when a navigation is added to the entity type.

INavigationAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on a navigation.

INavigationRemovedConvention

Represents an operation that should be performed when a navigation is removed from the entity type.

IPropertyAddedConvention

Represents an operation that should be performed when a property is added to the entity type.

IPropertyAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on a property.

IPropertyFieldChangedConvention

Represents an operation that should be performed when the backing field for a property is changed.

IPropertyNullabilityChangedConvention

Represents an operation that should be performed when the nullability for a property is changed.

IPropertyRemovedConvention

Represents an operation that should be performed when a property is removed from the entity type.

ISkipNavigationAddedConvention

Represents an operation that should be performed when a skip navigation is added to the entity type.

ISkipNavigationAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on a skip navigation.

ISkipNavigationForeignKeyChangedConvention

Represents an operation that should be performed when a skip navigation foreign key is changed.

ISkipNavigationInverseChangedConvention

Represents an operation that should be performed when a skip navigation inverse is changed.

ISkipNavigationRemovedConvention

Represents an operation that should be performed when a skip navigation is removed from the entity type.