共用方式為


ValueGenerationConvention 類別

定義

慣例,會將儲存值產生設定為 OnAdd 主鍵一部分的屬性,而不是任何外鍵的一部分。

public class ValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention
public class ValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention
type ValueGenerationConvention = class
    interface IEntityTypePrimaryKeyChangedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface IForeignKeyRemovedConvention
    interface IForeignKeyPropertiesChangedConvention
    interface IEntityTypeBaseTypeChangedConvention
type ValueGenerationConvention = class
    interface IEntityTypePrimaryKeyChangedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface IForeignKeyRemovedConvention
    interface IForeignKeyPropertiesChangedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IForeignKeyOwnershipChangedConvention
Public Class ValueGenerationConvention
Implements IEntityTypeBaseTypeChangedConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRemovedConvention
Public Class ValueGenerationConvention
Implements IEntityTypeBaseTypeChangedConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyAddedConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRemovedConvention
繼承
ValueGenerationConvention
衍生
實作

備註

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

建構函式

ValueGenerationConvention(ProviderConventionSetBuilderDependencies)

建立 ValueGenerationConvention 的新執行個體。

屬性

Dependencies

此服務的相依性。

方法

GetValueGenerated(IConventionProperty)

傳回為指定屬性設定的存放區值產生策略。

GetValueGenerated(IProperty)

傳回為指定屬性設定的存放區值產生策略。

GetValueGenerated(IReadOnlyProperty)

傳回為指定屬性設定的存放區值產生策略。

ProcessEntityTypeBaseTypeChanged(IConventionEntityTypeBuilder, IConventionEntityType, IConventionEntityType, IConventionContext<IConventionEntityType>)

在實體類型的基底類型變更之後呼叫。

ProcessEntityTypePrimaryKeyChanged(IConventionEntityTypeBuilder, IConventionKey, IConventionKey, IConventionContext<IConventionKey>)

變更實體類型的主鍵之後呼叫。

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

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

ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

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

ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

在外鍵的擁有權值變更之後呼叫。

ProcessForeignKeyPropertiesChanged(IConventionForeignKeyBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IReadOnlyList<IConventionProperty>>)

在外鍵屬性或主體索引鍵變更之後呼叫。

ProcessForeignKeyPropertiesChanged(IConventionRelationshipBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IConventionRelationshipBuilder>)

在外鍵屬性或主體索引鍵變更之後呼叫。

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

移除外鍵之後呼叫。

適用於