共用方式為


ForeignKeyAttributeConvention 類別

定義

根據屬性或導覽屬性上指定的 ,設定與導覽屬性 ForeignKeyAttribute 相關聯的外鍵屬性的慣例。

public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention
public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention
public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention
public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention
type ForeignKeyAttributeConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface IModelFinalizedConvention
type ForeignKeyAttributeConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface INavigationAddedConvention
    interface IModelFinalizingConvention
type ForeignKeyAttributeConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface INavigationAddedConvention
    interface ISkipNavigationForeignKeyChangedConvention
    interface IModelFinalizingConvention
type ForeignKeyAttributeConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface INavigationAddedConvention
    interface ISkipNavigationForeignKeyChangedConvention
    interface IPropertyAddedConvention
    interface IComplexPropertyAddedConvention
    interface IModelFinalizingConvention
Public Class ForeignKeyAttributeConvention
Implements IForeignKeyAddedConvention, IModelFinalizedConvention
Public Class ForeignKeyAttributeConvention
Implements IForeignKeyAddedConvention, IModelFinalizingConvention, INavigationAddedConvention
Public Class ForeignKeyAttributeConvention
Implements IEntityTypeAddedConvention, IForeignKeyAddedConvention, IModelFinalizingConvention, INavigationAddedConvention, ISkipNavigationForeignKeyChangedConvention
Public Class ForeignKeyAttributeConvention
Implements IComplexPropertyAddedConvention, IEntityTypeAddedConvention, IForeignKeyAddedConvention, IModelFinalizingConvention, INavigationAddedConvention, IPropertyAddedConvention, ISkipNavigationForeignKeyChangedConvention
繼承
ForeignKeyAttributeConvention
實作

備註

針對一對一關聯性,必須在指向主體的導覽屬性上指定屬性。

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

建構函式

ForeignKeyAttributeConvention(ProviderConventionSetBuilderDependencies)

建立 ForeignKeyAttributeConvention 的新執行個體。

屬性

Dependencies

此服務的相依性。

方法

ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

在將複雜屬性新增至類似類型的 物件之後呼叫。

ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

在實體類型新增至模型之後呼叫。

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

在將外鍵新增至實體類型之後呼叫。

ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在將外鍵新增至實體類型之後呼叫。

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在模型完成之後呼叫。

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

當模型完成時呼叫。

ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)

在導覽新增至實體類型之後呼叫。

ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在屬性新增至實體類型之後呼叫。

ProcessSkipNavigationForeignKeyChanged(IConventionSkipNavigationBuilder, IConventionForeignKey, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

在略過巡覽反向變更之後呼叫。

適用於