System.Data.Entity.ModelConfiguration.Conventions 命名空间

AssociationInverseDiscoveryConvention

用于在相关类型之间只存在一对导航属性时,将导航属性检测为相互反向的约定。

AttributeToColumnAnnotationConvention<TAttribute,TAnnotation>

Code First 约定的常规用途类,用于从 .NET 属性读取属性并基于这些属性生成列批注。

AttributeToTableAnnotationConvention<TAttribute,TAnnotation>

Code First 约定的常规用途类,用于从 .NET 类型读取属性并基于这些属性生成表批注。

ColumnAttributeConvention

处理在模型中的属性上找到 的 实例 ColumnAttribute 的约定

ColumnOrderingConvention

应用通过 ColumnAttribute 或 API 指定的列排序的 DbModelBuilder 约定。

ColumnOrderingConventionStrict

应用通过 ColumnAttribute 或 API 指定的列排序的 DbModelBuilder 约定。 如果检测到重复配置的列顺序,将引发此约定。

ColumnTypeCasingConvention

用于通过数据批注或 DbModelBuilder API 显式指定的任何数据类型转换为小写的约定。 默认 SqlClient 提供程序区分大小写,并且要求数据类型为小写。 此约定允许 System.ComponentModel.DataAnnotations.ColumnAttrbiuteDbModelBuilder API 不区分大小写。

ComplexTypeAttributeConvention

用于处理在模型中的类型上找到的 实例 ComplexTypeAttribute 的约定。

ComplexTypeDiscoveryConvention

约定:在没有主键、无映射基类型和导航属性的情况下,将类型配置为复杂类型。

ConcurrencyCheckAttributeConvention

用于处理在模型中的属性上找到的 实例 ConcurrencyCheckAttribute 的约定。

Convention

不重写配置的约定。

DatabaseGeneratedAttributeConvention

用于处理在模型中的属性上找到的 实例 DatabaseGeneratedAttribute 的约定。

DecimalPropertyConvention

用于为小数属性将精度设置为 18 并将小数位数设置为 2 的约定。

DeclaredPropertyOrderingConvention

用于移动主键属性使其首先出现的约定。

ForeignKeyAssociationMultiplicityConvention

用于基于外键属性的 CLR 可空性区分可选和必需关系的约定。

ForeignKeyDiscoveryConvention

发现外键属性的约定的基类。

ForeignKeyIndexConvention

引入外键索引的约定。

ForeignKeyNavigationPropertyAttributeConvention

用于处理在模型中的 ForeignKeyAttribute 导航属性上找到 的 实例的约定。

ForeignKeyPrimitivePropertyAttributeConvention

用于处理在模型中的 ForeignKeyAttribute 外键属性上发现的 的 实例的约定。

IdKeyDiscoveryConvention

用于检测主键属性的约定。 按优先级顺序识别的命名模式包括:

  1. “Id”
  2. [type name]ID 主键检测不区分大小写。
IndexAttributeConvention

用于发现 IndexAttribute 属性的属性并在模型中生成 IndexAnnotation 列批注的约定。

InversePropertyAttributeConvention

用于处理在模型中的属性上找到的 实例 InversePropertyAttribute 的约定。

KeyAttributeConvention

用于处理在模型中的属性上找到的 实例 KeyAttribute 的约定。

KeyDiscoveryConvention

发现主键属性的约定的基类。

ManyToManyCascadeDeleteConvention

约定:从多对多关系中涉及的两个表向联接表添加级联删除。

MappingInheritedPropertiesSupportConvention

用于确保在映射继承属性时不创建无效/不支持的映射的约定

MaxLengthAttributeConvention

用于处理在模型中的属性上找到的 实例 MaxLengthAttribute 的约定。

NavigationPropertyNameForeignKeyDiscoveryConvention

用于发现外键属性的约定,该外键属性的名称是依赖导航属性名称和主体类型主键属性名称 () 的组合。

NotMappedPropertyAttributeConvention

用于处理在模型中的属性上找到的 实例 NotMappedAttribute 的约定。

NotMappedTypeAttributeConvention

用于处理在模型中的类型上找到的 实例 NotMappedAttribute 的约定。

OneToManyCascadeDeleteConvention

用于为任何必需关系启用级联删除的约定。

OneToOneConstraintIntroductionConvention

将依赖实体类型的主键 () 配置为一对一关系中的外键 () 的约定。

PluralizingEntitySetNameConvention

用于将实体集名称设置为实体类型名称的复数版本的约定。

PluralizingTableNameConvention

用于将表名设置为实体类型名称的复数版本的约定。

PrimaryKeyNameForeignKeyDiscoveryConvention

用于发现名称与主体类型主键属性名称匹配的外键属性的约定。

PrimitivePropertyAttributeConfigurationConvention<TAttribute>

处理在模型中基元属性上找到的 CLR 属性的约定的基类。

PropertyAttributeConfigurationConvention<TAttribute>

处理在模型中类型属性上找到的 CLR 属性的约定的基类。

PropertyMaxLengthConvention

为类型支持长度分面的属性设置最大长度的约定。 默认值为 128。

RequiredNavigationPropertyAttributeConvention

用于处理在模型中的 RequiredAttribute 导航属性上找到 的 实例的约定。

RequiredPrimitivePropertyAttributeConvention

用于处理在模型中基 RequiredAttribute 元属性上发现的 的 实例的约定。

SqlCePropertyMaxLengthConvention

约定:在 SqlCe 是提供程序时,为类型支持长度分面的属性设置默认最大长度 4000。

StoreGeneratedIdentityKeyConvention

用于将整数主键配置为标识的约定。

StringLengthAttributeConvention

用于处理在模型中的属性上找到的 实例 StringLengthAttribute 的约定。

TableAttributeConvention

用于处理在模型中的类型上找到的 实例 TableAttribute 的约定。

TimestampAttributeConvention

用于处理在模型中的属性上找到的 实例 TimestampAttribute 的约定。

TypeAttributeConfigurationConvention<TAttribute>

处理在模型中找到的 CLR 属性的约定的基类。

TypeNameForeignKeyDiscoveryConvention

用于发现名称是主体类型名称和主体类型主键属性名称组合的外键属性的约定。

接口

IConceptualModelConvention<T>

一个约定,在创建模型后对模型的概念部分进行操作。

IConvention

标识可以添加到实例或从实例中删除的 DbModelBuilder 约定。

IStoreModelConvention<T>

一个约定,在创建模型后对模型的数据库部分进行操作。