語言

CosmosValueGenerationConvention 類別

定義

這是一種將儲存值產生設定為 OnAdd 主鍵一部分的屬性,而非任何外鍵,或設定為資料庫預設值的屬性的慣例。

public class CosmosValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention
type CosmosValueGenerationConvention = class
    inherit ValueGenerationConvention
    interface IEntityTypeAnnotationChangedConvention
    interface IConvention
Public Class CosmosValueGenerationConvention
Inherits ValueGenerationConvention
Implements IEntityTypeAnnotationChangedConvention
繼承
CosmosValueGenerationConvention
實作

備註

更多資訊與範例請參閱 模型建構慣例 與 EF核心價值生成 。

建構函式

名稱 Description
CosmosValueGenerationConvention(ProviderConventionSetBuilderDependencies)

建立一個新的 實例。CosmosValueGenerationConvention

屬性

名稱 Description
Dependencies

此服務的依賴關係。

(繼承來源 ValueGenerationConvention)

方法

名稱 Description
GetValueGenerated(IConventionProperty)

回傳為特定屬性設定的店鋪價值生成策略。

ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

在某個實體類型更改註解後呼叫。

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

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

(繼承來源 ValueGenerationConvention)
ProcessEntityTypePrimaryKeyChanged(IConventionEntityTypeBuilder, IConventionKey, IConventionKey, IConventionContext<IConventionKey>)

在實體類型的主金鑰被更改後呼叫。

(繼承來源 ValueGenerationConvention)
ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

在實體類型中加入外鍵後呼叫。

(繼承來源 ValueGenerationConvention)
ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

在外金鑰的所有權值改變後才被呼叫。

(繼承來源 ValueGenerationConvention)
ProcessForeignKeyPropertiesChanged(IConventionForeignKeyBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IReadOnlyList<IConventionProperty>>)

在外鍵屬性或主鍵變更後被呼叫。

(繼承來源 ValueGenerationConvention)
ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

在移除外金鑰後呼叫。

(繼承來源 ValueGenerationConvention)

適用於