語言

KeyComplexPropertyConvention 類別

定義

一個將鍵所用屬性路徑中每個複雜屬性標記為必要條件的慣例,因為必須有該屬性的值才能計算出該鍵值。

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

備註

當最後一個引用金鑰被移除時,只要沒有其他金鑰持續使用該鏈,且使用者未執行明確配置,這裡所套用的隱含不可空配置就會被還原。

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

建構函式

名稱 Description
KeyComplexPropertyConvention(ProviderConventionSetBuilderDependencies)

一個將鍵所用屬性路徑中每個複雜屬性標記為必要條件的慣例,因為必須有該屬性的值才能計算出該鍵值。

屬性

名稱 Description
Dependencies

此服務的依賴關係。

方法

名稱 Description
ProcessKeyAdded(IConventionKeyBuilder, IConventionContext<IConventionKeyBuilder>)

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

ProcessKeyRemoved(IConventionEntityTypeBuilder, IConventionKey, IConventionContext<IConventionKey>)

鑰匙被取走後才呼叫。

適用於