語言

SqliteValueGenerationConvention 類別

定義

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

[System.Runtime.CompilerServices.Nullable(0)]
public class SqliteValueGenerationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention
[<System.Runtime.CompilerServices.Nullable(0)>]
type SqliteValueGenerationConvention = class
    inherit RelationalValueGenerationConvention
Public Class SqliteValueGenerationConvention
Inherits RelationalValueGenerationConvention
繼承
屬性

備註

更多資訊與範例請參閱 模型建構慣例及使用 EF Core 存取 SQLite 資料庫 。

建構函式

名稱 Description
SqliteValueGenerationConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

建立一個新的 實例。SqliteValueGenerationConvention

屬性

名稱 Description
Dependencies

此服務的依賴關係。

(繼承來源 ValueGenerationConvention)
RelationalDependencies

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

(繼承來源 RelationalValueGenerationConvention)

方法

名稱 Description
GetValueGenerated(IConventionProperty)

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

MappingStrategyAllowsValueGeneration(IConventionProperty, String)

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

(繼承來源 RelationalValueGenerationConvention)
ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

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

(繼承來源 RelationalValueGenerationConvention)
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)
ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

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

適用於