Partilhar via


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]
  • [property name]_
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.

CheckConstraintConvention

A convention that ensures that the check constraints on the derived types are compatible with the check constraints on the base type. And also ensures that the declaring type is current.

ComplexPropertyDiscoveryConvention

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.

ComplexTypeAttributeConvention

A convention that configures types that have the ComplexTypeAttribute.

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.

CosmosInversePropertyAttributeConvention

A convention that configures the inverse navigation property based on the InversePropertyAttribute specified on the other navigation property. All navigations are assumed to be targeting owned entity types for Cosmos.

CosmosJsonIdConvention

A convention that configures mapping the PK and/or discriminator properties to the JSON 'id' property.

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.

CosmosManyToManyJoinEntityTypeConvention

A convention that creates a join entity type for a many-to-many relationship and adds a partition key to it if the related types share one.

CosmosPartitionKeyInPrimaryKeyConvention

A convention that adds partition key properties to the EF primary key and adds the '__jObject' containing the JSON object returned by the store.

CosmosRelationshipDiscoveryConvention

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. All navigations are assumed to be targeting owned entity types for Cosmos.

CosmosRuntimeModelConvention

A convention that creates an optimized copy of the mutable model. This convention is typically implemented by database providers to update provider annotations when creating a read-only model.

CosmosValueGenerationConvention

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.

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 EntityQueryRootExpression. This makes them consistent with how DbSet accesses in the actual queries are represented, which allows for easier processing in the query pipeline.

DeleteBehaviorAttributeConvention

A convention that configures the delete behavior based on the DeleteBehaviorAttribute applied on the property.

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.

DiscriminatorLengthConvention

A convention that sets the maximum length for string discriminator properties.

ElementMappingConvention

A convention that ensures property mappings have any ElementMapping discovered by the type mapper.

ElementTypeChangedConvention

A convention that reacts to changes made to element types of primitive collections.

EntitySplittingConvention

A convention that creates linking relationships for entity splitting and manages the mapping fragments.

EntityTypeAttributeConventionBase<TAttribute>

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

EntityTypeConfigurationAttributeConvention

A convention that applies the entity type configuration specified in EntityTypeConfigurationAttribute.

EntityTypeConfigurationEntityTypeAttributeConvention

A convention that applies the entity type configuration specified in EntityTypeConfigurationAttribute.

EntityTypeHierarchyMappingConvention

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

ETagPropertyConvention

A convention that adds etag metadata on the concurrency token, if present.

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.

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
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 or PrimaryKeyAttribute specified on a CLR type.

KeyDiscoveryConvention

A convention that finds primary key property for the entity type based on the names, ignoring case:

  • Id
  • [entity name]Id
KeylessAttributeConvention

A convention that ignores entity types that have the KeylessAttribute.

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.

NotMappedTypeAttributeConvention

A convention that ignores entity types that have the NotMappedAttribute.

OwnedAttributeConvention

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

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.

PrecisionAttributeConvention

A convention that configures the Precision based on the PrecisionAttribute applied on the property.

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.

PropertyOverridesConvention

A convention that ensures that the declaring property is current for the property overrides.

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 EntityQueryRootExpression. 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 EntityQueryRootExpression.

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.

RelationalKeyDiscoveryConvention

A relational-specific convention inheriting from KeyDiscoveryConvention.

RelationalMapToJsonConvention

A convention that configures default settings for an entity mapped to a JSON column.

RelationalMaxIdentifierLengthConvention

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

RelationalModelConvention

A convention that precomputes a relational model.

RelationalNavigationJsonPropertyNameAttributeConvention

A convention that configures a JSON element name for the navigation property mapped to json based on the JsonPropertyNameAttribute attribute.

RelationalPropertyJsonPropertyNameAttributeConvention

A convention that configures JSON property name based on the applied JsonPropertyNameAttribute.

RelationalQueryFilterDefiningQueryRewritingConvention
RelationalQueryFilterDefiningQueryRewritingConvention.RelationalDbSetAccessRewritingExpressionVisitor
RelationalQueryFilterRewritingConvention

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

RelationalQueryFilterRewritingConvention.RelationalDbSetAccessRewritingExpressionVisitor

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

RelationalRuntimeModelConvention

A convention that creates an optimized copy of the mutable model. This convention is typically implemented by database providers to update provider annotations when creating a read-only model.

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.

RuntimeModelConvention

A convention that creates an optimized copy of the mutable model. This convention is typically implemented by database providers to update provider annotations when creating a read-only model.

RuntimeModelConvention.QueryRootRewritingExpressionVisitor

A visitor that rewrites EntityQueryRootExpression encountered in an expression to use a different entity type.

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.

SqliteRuntimeModelConvention

A convention that creates an optimized copy of the mutable model.

SqliteSharedTableConvention

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

SqlServerConventionSetBuilder

A builder for building conventions for SQL Server.

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

SqlServerOutputClauseConvention

A convention that configures tables with triggers to not use the OUTPUT clause when saving changes.

SqlServerRuntimeModelConvention

A convention that creates an optimized copy of the mutable model.

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.

SqlServerTemporalConvention

A convention that manipulates temporal settings for an entity mapped to a temporal table.

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.

StoredProcedureConvention

A convention that ensures that the entity type is current for the stored procedures.

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.

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.

TypeAttributeConventionBase<TAttribute>

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

TypeMappingConvention

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

UnicodeAttributeConvention

A convention that configures the Unicode based on the UnicodeAttribute applied on the property.

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

IComplexPropertyAddedConvention

Represents an operation that should be performed when a complex property is added to an type-like object.

IComplexPropertyAnnotationChangedConvention

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

IComplexPropertyFieldChangedConvention

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

IComplexPropertyNullabilityChangedConvention

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

IComplexPropertyRemovedConvention

Represents an operation that should be performed when a complex property is removed from a type-like object.

IComplexTypeAnnotationChangedConvention

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

IComplexTypeMemberIgnoredConvention

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

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.

IDiscriminatorPropertySetConvention

Represents an operation that should be performed when a discriminator property is set for an entity type.

IElementTypeAnnotationChangedConvention

Represents an operation that should be performed when an annotation is changed on the elements of a collection property.

IElementTypeNullabilityChangedConvention

Represents an operation that should be performed when the nullability on the elements of a collection property has changed.

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.

IForeignKeyNullNavigationSetConvention

Represents an operation that should be performed when a navigation is set to null on a foreign key.

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.

IIndexSortOrderChangedConvention

Represents an operation that should be performed when the sort order of an index is changed.

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.

IModelEmbeddedDiscriminatorNameConvention

Represents an operation that should be performed when the embedded discriminator name for the model changes.

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.

IPropertyElementTypeChangedConvention

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

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.

ITriggerAddedConvention

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

ITriggerRemovedConvention

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

ITypeIgnoredConvention

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