ForeignKeyPropertyDiscoveryConvention 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
根據關聯性名稱尋找外鍵屬性的慣例,忽略大小寫:
- [導覽屬性名稱][principal key property name]
- [導覽屬性名稱]Id
- [主體機構名稱][principal key property name]
- [主體機構名稱]Id
public class ForeignKeyPropertyDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRequirednessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyNullabilityChangedConvention
public class ForeignKeyPropertyDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRequirednessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyNullabilityChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationInverseChangedConvention
type ForeignKeyPropertyDiscoveryConvention = class
interface IForeignKeyAddedConvention
interface IConvention
interface INavigationAddedConvention
interface IPropertyAddedConvention
interface IEntityTypeMemberIgnoredConvention
interface IPropertyNullabilityChangedConvention
interface IPropertyFieldChangedConvention
interface IForeignKeyPropertiesChangedConvention
interface IForeignKeyPrincipalEndChangedConvention
interface IForeignKeyUniquenessChangedConvention
interface IForeignKeyRequirednessChangedConvention
interface IKeyAddedConvention
interface IKeyRemovedConvention
interface IEntityTypePrimaryKeyChangedConvention
interface IModelFinalizedConvention
type ForeignKeyPropertyDiscoveryConvention = class
interface IEntityTypeMemberIgnoredConvention
interface IConvention
interface IEntityTypePrimaryKeyChangedConvention
interface IForeignKeyAddedConvention
interface IForeignKeyPropertiesChangedConvention
interface IForeignKeyPrincipalEndChangedConvention
interface IForeignKeyUniquenessChangedConvention
interface IForeignKeyRequirednessChangedConvention
interface IKeyAddedConvention
interface IKeyRemovedConvention
interface INavigationAddedConvention
interface ISkipNavigationForeignKeyChangedConvention
interface ISkipNavigationInverseChangedConvention
interface IPropertyAddedConvention
interface IPropertyNullabilityChangedConvention
interface IPropertyFieldChangedConvention
interface IModelFinalizingConvention
Public Class ForeignKeyPropertyDiscoveryConvention
Implements IEntityTypeMemberIgnoredConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyPrincipalEndChangedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRequirednessChangedConvention, IForeignKeyUniquenessChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelFinalizedConvention, INavigationAddedConvention, IPropertyAddedConvention, IPropertyFieldChangedConvention, IPropertyNullabilityChangedConvention
Public Class ForeignKeyPropertyDiscoveryConvention
Implements IEntityTypeMemberIgnoredConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyPrincipalEndChangedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRequirednessChangedConvention, IForeignKeyUniquenessChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelFinalizingConvention, INavigationAddedConvention, IPropertyAddedConvention, IPropertyFieldChangedConvention, IPropertyNullabilityChangedConvention, ISkipNavigationForeignKeyChangedConvention, ISkipNavigationInverseChangedConvention
- 繼承
-
ForeignKeyPropertyDiscoveryConvention
- 實作
-
IConvention IEntityTypeMemberIgnoredConvention IEntityTypePrimaryKeyChangedConvention IForeignKeyAddedConvention IForeignKeyPrincipalEndChangedConvention IForeignKeyPropertiesChangedConvention IForeignKeyRequirednessChangedConvention IForeignKeyUniquenessChangedConvention IKeyAddedConvention IKeyRemovedConvention IModelFinalizedConvention INavigationAddedConvention IPropertyAddedConvention IPropertyFieldChangedConvention IPropertyNullabilityChangedConvention IModelFinalizingConvention ISkipNavigationForeignKeyChangedConvention ISkipNavigationInverseChangedConvention
備註
如果找不到相符的屬性,則關聯性不代表擁有權、相依端不模棱兩可,而且不會衍生,如果關聯性是一對一,則會使用主鍵屬性,否則慣例會嘗試比對屬性與完全名稱做為主體索引鍵屬性,因為它們是相依 PK 的適當子集。
如果找到相符專案,但屬性類型與主體索引鍵類型不相容,則不會再搜尋相符專案。
如果關聯性使用慣例所建立的陰影屬性,則會重新建立它們,以移除用來讓名稱成為唯一的尾碼。
如需詳細資訊和範例,請參閱 模型建置慣例 。
建構函式
ForeignKeyPropertyDiscoveryConvention(ProviderConventionSetBuilderDependencies) |
建立 ForeignKeyPropertyDiscoveryConvention 的新執行個體。 |
屬性
Dependencies |
此服務的相依性。 |