共用方式為


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 可為 Null 的屬性來區別選擇性和必要關聯性的慣例。

ForeignKeyDiscoveryConvention

探索外鍵屬性之慣例的基類。

ForeignKeyIndexConvention

引進外鍵索引的慣例。

ForeignKeyNavigationPropertyAttributeConvention

在模型中流覽屬性上找到的 ForeignKeyAttribute 實例的慣例。

ForeignKeyPrimitivePropertyAttributeConvention

處理在模型中外鍵屬性上找到之 ForeignKeyAttribute 實例的慣例。

IdKeyDiscoveryConvention

偵測主索引鍵屬性的慣例。 依優先順序辨識的命名模式如下:

  1. 'Id'
  2. [類型名稱]識別碼主鍵偵測不區分大小寫。
IndexAttributeConvention

在模型中探索 IndexAttribute 屬性和產生 IndexAnnotation 資料行批註的慣例。

InversePropertyAttributeConvention

處理在模型中屬性上找到之 InversePropertyAttribute 實例的慣例。

KeyAttributeConvention

處理在模型中屬性上找到之 KeyAttribute 實例的慣例。

KeyDiscoveryConvention

探索主鍵屬性之慣例的基類。

ManyToManyCascadeDeleteConvention

將串聯刪除新增至聯結資料表的慣例,這些資料表涉及許多關聯性。

MappingInheritedPropertiesSupportConvention

確保對應繼承屬性時,不會建立無效/不支援的對應慣例

MaxLengthAttributeConvention

處理在模型中屬性上找到之 MaxLengthAttribute 實例的慣例。

NavigationPropertyNameForeignKeyDiscoveryConvention

用來探索名稱為相依導覽屬性名稱與主體型別主索引鍵屬性名稱組合之外部索引鍵屬性的慣例。

NotMappedPropertyAttributeConvention

處理在模型中屬性上找到之 NotMappedAttribute 實例的慣例。

NotMappedTypeAttributeConvention

在模型中的型別上處理 的實例 NotMappedAttribute 的慣例。

OneToManyCascadeDeleteConvention

針對任何必要的關聯性啟用串聯刪除的慣例。

OneToOneConstraintIntroductionConvention

將相依實體類型的主鍵 () 設定為一對一關聯性中外鍵 (s) 的慣例。

PluralizingEntitySetNameConvention

將實體集名稱設定為實體型別名稱之複數化版本的慣例。

PluralizingTableNameConvention

將資料表名稱設定為實體型別名稱之複數化版本的慣例。

PrimaryKeyNameForeignKeyDiscoveryConvention

用來探索名稱符合主體型別主索引鍵屬性名稱之外部索引鍵屬性的慣例。

PrimitivePropertyAttributeConfigurationConvention<TAttribute>

處理在模型中基本屬性上找到 CLR 屬性的慣例基類。

PropertyAttributeConfigurationConvention<TAttribute>

處理在模型中類型屬性上找到 CLR 屬性的慣例基類。

PropertyMaxLengthConvention

針對類型支援長度 Facet 的屬性設定最大長度的慣例。 預設值為 128。

RequiredNavigationPropertyAttributeConvention

在模型中流覽屬性上找到的 RequiredAttribute 實例的慣例。

RequiredPrimitivePropertyAttributeConvention

處理在模型中基本屬性上找到之 RequiredAttribute 實例的慣例。

SqlCePropertyMaxLengthConvention

當 SqlCe 是提供者時,其類型支援長度 Facet 之屬性的預設長度上限為 4000 的慣例。

StoreGeneratedIdentityKeyConvention

將整數主索引鍵設定為識別的慣例。

StringLengthAttributeConvention

處理在模型中屬性上找到之 StringLengthAttribute 實例的慣例。

TableAttributeConvention

在模型中的型別上處理 的實例 TableAttribute 的慣例。

TimestampAttributeConvention

處理在模型中屬性上找到之 TimestampAttribute 實例的慣例。

TypeAttributeConfigurationConvention<TAttribute>

處理模型中找到之 CLR 屬性的慣例基類。

TypeNameForeignKeyDiscoveryConvention

用來探索名稱為主體型別名稱與主體型別主索引鍵屬性名稱組合之外部索引鍵屬性的慣例。

介面

IConceptualModelConvention<T>

建立模型之後,在模型的概念區段上運作的慣例。

IConvention

識別可以加入或移除實例的 DbModelBuilder 慣例。

IStoreModelConvention<T>

建立模型之後,在模型的資料庫區段上運作的慣例。