ConventionSet 類別

定義

表示用來建置模型的一組慣例。

public class ConventionSet
type ConventionSet = class
Public Class ConventionSet
繼承
ConventionSet

備註

如需詳細資訊和範例,請參閱 模型建置慣例

建構函式

ConventionSet()

表示用來建置模型的一組慣例。

屬性

BaseEntityTypeChangedConventions

變更基底實體類型時要執行的慣例。

BaseEntityTypeSetConventions

設定或移除基底實體類型時要執行的慣例。

ComplexPropertyAddedConventions

將實體類型新增至模型時要執行的慣例。

ComplexPropertyAnnotationChangedConventions

在複雜屬性上設定或移除注釋時要執行的慣例。

ComplexPropertyFieldChangedConventions

屬性欄位變更時要執行的慣例。

ComplexPropertyNullabilityChangedConventions

屬性的可為 Null 性變更時要執行的慣例。

ComplexPropertyRemovedConventions

移除實體類型時要執行的慣例。

ComplexTypeAnnotationChangedConventions

在複雜類型上設定或移除注釋時要執行的慣例。

ComplexTypeMemberIgnoredConventions

忽略屬性時要執行的慣例。

DiscriminatorPropertySetConventions

設定辨別子屬性時要執行的慣例。

ElementTypeAnnotationChangedConventions

在集合的 元素上變更注釋時要執行的慣例。

ElementTypeNullabilityChangedConventions

變更集合專案之 Null 性時所要執行的慣例。

EntityTypeAddedConventions

將實體類型新增至模型時要執行的慣例。

EntityTypeAnnotationChangedConventions

在實體類型上設定或移除注釋時要執行的慣例。

EntityTypeAnnotationSetConventions

在實體類型上設定或移除注釋時要執行的慣例。

EntityTypeBaseTypeChangedConventions

變更基底實體類型時要執行的慣例。

EntityTypeIgnoredConventions

忽略實體類型時要執行的慣例。

EntityTypeMemberIgnoredConventions

忽略屬性時要執行的慣例。

EntityTypePrimaryKeyChangedConventions

變更主鍵時要執行的慣例。

EntityTypeRemovedConventions

移除實體類型時要執行的慣例。

ForeignKeyAddedConventions

新增外鍵時要執行的慣例。

ForeignKeyAnnotationChangedConventions

在外鍵上變更注釋時要執行的慣例。

ForeignKeyDependentRequirednessChangedConventions

當外鍵必要性變更時要執行的慣例。

ForeignKeyNullNavigationSetConventions

當導覽設定 null 為外鍵時所執行的慣例。

ForeignKeyOwnershipChangedConventions

變更外鍵擁有權時要執行的慣例。

ForeignKeyPrincipalEndChangedConventions

設定關聯性主體結尾時要執行的慣例。

ForeignKeyPropertiesChangedConventions

變更外鍵的屬性或主鍵時要執行的慣例。

ForeignKeyRemovedConventions

移除外鍵時要執行的慣例。

ForeignKeyRequirednessChangedConventions

當外鍵必要性變更時要執行的慣例。

ForeignKeyUniquenessChangedConventions

變更外鍵唯一性時要執行的慣例。

ForeignKeyUniquenessConventions

變更外鍵唯一性時要執行的慣例。

IndexAddedConventions

新增索引時要執行的慣例。

IndexAnnotationChangedConventions

在索引上變更注釋時要執行的慣例。

IndexRemovedConventions

移除索引時要執行的慣例。

IndexSortOrderChangedConventions

變更索引排序次序時要執行的慣例。

IndexUniquenessChangedConventions

變更索引唯一性時要執行的慣例。

IndexUniquenessConventions

變更索引唯一性時要執行的慣例。

KeyAddedConventions

新增索引鍵時要執行的慣例。

KeyAnnotationChangedConventions

在索引鍵上變更注釋時要執行的慣例。

KeyRemovedConventions

移除索引鍵時要執行的慣例。

ModelAnnotationChangedConventions

在模型上設定或移除注釋時要執行的慣例。

ModelBuiltConventions

模型建置完成時要執行的慣例。

ModelFinalizedConventions

完成模型驗證時要執行的慣例。

ModelFinalizingConventions

模型建置完成時要執行的慣例。

ModelInitializedConventions

執行以設定初始模型的慣例。

NavigationAddedConventions

新增導覽屬性時要執行的慣例。

NavigationAnnotationChangedConventions

在導覽屬性上變更注釋時執行的慣例。

NavigationRemovedConventions

移除導覽屬性時要執行的慣例。

PrimaryKeyChangedConventions

變更主鍵時要執行的慣例。

PrimaryKeySetConventions

設定主鍵時要執行的慣例。

PrincipalEndChangedConventions

設定關聯性主體結尾時要執行的慣例。

PrincipalEndSetConventions

設定關聯性主體結尾時要執行的慣例。

PropertyAddedConventions

新增屬性時要執行的慣例。

PropertyAnnotationChangedConventions

在屬性上變更注釋時要執行的慣例。

PropertyElementTypeChangedConventions

屬性欄位變更時要執行的慣例。

PropertyFieldChangedConventions

屬性欄位變更時要執行的慣例。

PropertyNullabilityChangedConventions

屬性的可為 Null 性變更時要執行的慣例。

PropertyNullableChangedConventions

屬性的可為 Null 性變更時要執行的慣例。

PropertyRemovedConventions

移除屬性時要執行的慣例。

SkipNavigationAddedConventions

新增略過導覽屬性時要執行的慣例。

SkipNavigationAnnotationChangedConventions

略過導覽屬性上的注釋變更時要執行的慣例。

SkipNavigationForeignKeyChangedConventions

略過導覽外鍵變更時要執行的慣例。

SkipNavigationInverseChangedConventions

略過導覽反轉變更時要執行的慣例。

SkipNavigationRemovedConventions

移除略過導覽屬性時要執行的慣例。

TriggerAddedConventions

新增觸發程式屬性時要執行的慣例。

TriggerRemovedConventions

移除觸發程式屬性時要執行的慣例。

TypeIgnoredConventions

忽略類型時要執行的慣例。

方法

Add(IConvention)

將慣例新增至集合。

AddAfter<TConvention>(IList<TConvention>, TConvention, Type)

在現有的慣例之後加入慣例。

AddAfter<TConvention>(List<TConvention>, TConvention, Type)

在現有的慣例之後加入慣例。

AddBefore<TConvention>(IList<TConvention>, TConvention, Type)

在現有的慣例之前加入慣例。

AddBefore<TConvention>(List<TConvention>, TConvention, Type)

在現有的慣例之前加入慣例。

CreateConventionSet(DbContext)

使用 外部 OnModelCreating(ModelBuilder)ModelBuilder ,呼叫這個方法,只針對核心服務建置 ConventionSet

請注意,使用這個方法並不尋常。 請考慮改用一般方式。 DbContext

Remove(Type)

移除指定型別的慣例。

Remove<TConvention>(IList<TConvention>, Type)

移除現有的慣例。

Remove<TConvention>(List<TConvention>, Type)

移除現有的慣例。

Replace<TConvention,TImplementation>(IList<TConvention>, TImplementation)

以衍生慣例取代現有的慣例。

Replace<TConvention,TImplementation>(List<TConvention>, TImplementation)

以衍生慣例取代現有的慣例。

Replace<TImplementation>(TImplementation)

以衍生慣例取代現有的慣例。 此外,也會為現有慣例未實作的任何慣例類型註冊新的慣例。

適用於