語言

RelationalKeyDiscoveryConvention 類別

定義

一個繼承自 KeyDiscoveryConvention的關係特定慣例。

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

備註

更多資訊與範例請參閱 模型建構慣例 。

建構函式

名稱 Description
RelationalKeyDiscoveryConvention(ProviderConventionSetBuilderDependencies, RelationalConventionSetBuilderDependencies)

建立一個新的 實例。RelationalKeyDiscoveryConvention

欄位

名稱 Description
SynthesizedOrdinalPropertyName

這是一個內部 API,支援 Entity Framework Core 基礎架構,且不受公開 API 相同的相容性標準約束。 該內容可能會在任何新聞稿中未經通知而更改或移除。 你應該只在程式碼中直接使用它,並且要非常謹慎,並且要知道這樣做可能會導致更新到新的 Entity Framework Core 版本時應用程式失敗。

屬性

名稱 Description
Dependencies

此服務的依賴關係。

(繼承來源 KeyDiscoveryConvention)
RelationalDependencies

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

方法

名稱 Description
DiscoverKeyProperties(IConventionEntityType)

回傳應該用於主鍵的屬性。

ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

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

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

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

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

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

(繼承來源 KeyDiscoveryConvention)
ProcessEntityTypeMemberIgnored(IConventionEntityTypeBuilder, String, IConventionContext<String>)

在忽略某個實體類型的成員後被呼叫。

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

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

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

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

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

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

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

在移除外金鑰後呼叫。

(繼承來源 KeyDiscoveryConvention)
ProcessForeignKeyUniquenessChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

在外鍵唯一性變更後被呼叫。

(繼承來源 KeyDiscoveryConvention)
ProcessKeyProperties(IList<IConventionProperty>, IConventionEntityType)

新增或移除用於主鍵的屬性。

ProcessKeyRemoved(IConventionEntityTypeBuilder, IConventionKey, IConventionContext<IConventionKey>)

這是一個內部 API,支援 Entity Framework Core 基礎架構,且不受公開 API 相同的相容性標準約束。 該內容可能會在任何新聞稿中未經通知而更改或移除。 你應該只在程式碼中直接使用它,並且要非常謹慎,並且要知道這樣做可能會導致更新到新的 Entity Framework Core 版本時應用程式失敗。

(繼承來源 KeyDiscoveryConvention)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在物件類型中加入屬性後呼叫。

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

在跳過導覽反向改變後被呼叫。

(繼承來源 KeyDiscoveryConvention)
ShouldDiscoverKeyProperties(IConventionEntityType)

決定是否應該為該實體類型發現關鍵屬性。

(繼承來源 KeyDiscoveryConvention)
TryConfigurePrimaryKey(IConventionEntityTypeBuilder)

發現主要金鑰候選,並在找到時配置主金鑰。

(繼承來源 KeyDiscoveryConvention)

適用於