語言

RelationalValueGenerationConvention 類別

定義

這是一種將儲存值產生設定為 OnAdd 主鍵一部分的屬性,而非任何外鍵,或設定為資料庫預設值的屬性的慣例。 它也會將屬性配置成 OnAddOrUpdate 計算欄位。

[System.Runtime.CompilerServices.Nullable(0)]
public class RelationalValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention
public class RelationalValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention
public class RelationalValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention
[<System.Runtime.CompilerServices.Nullable(0)>]
type RelationalValueGenerationConvention = class
    inherit ValueGenerationConvention
    interface IPropertyAnnotationChangedConvention
    interface IConvention
    interface IEntityTypeAnnotationChangedConvention
type RelationalValueGenerationConvention = class
    inherit ValueGenerationConvention
    interface IPropertyAnnotationChangedConvention
    interface IConvention
type RelationalValueGenerationConvention = class
    inherit ValueGenerationConvention
    interface IPropertyAnnotationChangedConvention
    interface IConvention
    interface IEntityTypeAnnotationChangedConvention
Public Class RelationalValueGenerationConvention
Inherits ValueGenerationConvention
Implements IEntityTypeAnnotationChangedConvention, IPropertyAnnotationChangedConvention
Public Class RelationalValueGenerationConvention
Inherits ValueGenerationConvention
Implements IPropertyAnnotationChangedConvention
繼承
RelationalValueGenerationConvention
衍生
屬性
實作

備註

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

建構函式

名稱 Description
RelationalValueGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

建立一個新的 實例。RelationalValueGenerationConvention

屬性

名稱 Description
Dependencies

此服務的依賴關係。

(繼承來源 ValueGenerationConvention)
RelationalDependencies

此服務的關聯提供者專屬相依關係。

方法

名稱 Description
GetValueGenerated(IConventionProperty)

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

GetValueGenerated(IProperty, StoreObjectIdentifier)

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

GetValueGenerated(IProperty)

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

GetValueGenerated(IReadOnlyProperty, StoreObjectIdentifier)

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

MappingStrategyAllowsValueGeneration(IConventionProperty, String)

檢查映射策略與性質是否允許以慣例產生價值。

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)
ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

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

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

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

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

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

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

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

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

在移除外金鑰後呼叫。

(繼承來源 ValueGenerationConvention)
ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

在屬性的註解被更改後呼叫。

適用於