IMutableForeignKey 介面

定義

表示關聯性,其中相依實體類型中的外鍵屬性 () 參考主體實體類型中對應的主鍵或替代索引鍵。

public interface IMutableForeignKey : Microsoft.EntityFrameworkCore.Metadata.IForeignKey, Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable
public interface IMutableForeignKey : Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyForeignKey
type IMutableForeignKey = interface
    interface IForeignKey
    interface IAnnotatable
    interface IMutableAnnotatable
type IMutableForeignKey = interface
    interface IReadOnlyForeignKey
    interface IReadOnlyAnnotatable
    interface IMutableAnnotatable
Public Interface IMutableForeignKey
Implements IForeignKey, IMutableAnnotatable
Public Interface IMutableForeignKey
Implements IMutableAnnotatable, IReadOnlyForeignKey
實作

備註

此介面會在模型建立期間使用,並允許修改中繼資料。 建置模型之後, IForeignKey 表示相同中繼資料的唯讀檢視。

如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。

屬性

DeclaringEntityType

取得相依實體類型。 這可能與在繼承階層中定義衍生型別時所定義的型 Properties 別不同 (,因為屬性可以在基底類型上定義) 。

DeleteBehavior

取得或設定值,指出刪除作業如何在刪除主體或中斷關聯性時套用至關聯性中的相依實體。

DependentToPrincipal

取得指向主體實體之相依實體類型的導覽屬性。

IsOwnership

取得或設定值,指出這個關聯性是否定義擁有權。 如果為 true,則必須一律透過主體實體的導覽來存取相依實體。

IsRequired

設定值,指出是否需要主體實體。 如果 true 為 ,則相依實體必須一律指派給有效的主體實體。

IsRequiredDependent

設定值,指出是否需要相依實體。 如果 true 為 ,則主體實體必須一律指派有效的相依實體。

IsUnique

取得或設定值,指出指派給外鍵屬性的值是否是唯一的。

Item[String]

取得具有指定名稱之注釋的值,如果不存在,則傳 null 回 。

(繼承來源 IReadOnlyAnnotatable)
PrincipalEntityType

取得這個關聯性目標的主要實體類型。 這可能與當關聯性以繼承階層中的衍生型別為目標時所定義的類型 PrincipalKey 不同 (,因為索引鍵是在階層的基底類型上定義) 。

PrincipalKey

取得關聯性目標的主要或替代索引鍵。

PrincipalToDependent

取得指向相依實體之主體實體類型的導覽屬性。

Properties

取得相依實體中的外鍵屬性。

方法

AddAnnotation(String, Object)

將注釋加入至這個物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 IMutableAnnotatable)
AddAnnotations(IEnumerable<IAnnotation>)

將批註加入物件。

(繼承來源 IMutableAnnotatable)
AddRuntimeAnnotation(String, Object)

將執行時間批註新增至這個 物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 IAnnotatable)
AnnotationsToDebugString(Int32)

取得 物件上宣告之所有注釋的偵錯字串。

(繼承來源 IReadOnlyAnnotatable)
FindAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則傳 null 回 。

(繼承來源 IReadOnlyAnnotatable)
FindRuntimeAnnotation(String)

取得具有指定名稱的執行時間批註,如果不存在,則 null 傳回 。

(繼承來源 IAnnotatable)
FindRuntimeAnnotationValue(String)

取得具有指定名稱的執行時間批註值,如果不存在,則傳 null 回 。

(繼承來源 IAnnotatable)
GetAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則會擲回。

(繼承來源 IReadOnlyAnnotatable)
GetAnnotations()

取得目前 物件上的所有批註。

(繼承來源 IReadOnlyAnnotatable)
GetDependentKeyValueFactory()

根據從各種實體資料形式取得的外鍵值,建立索引鍵值的處理站。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

(繼承來源 IForeignKey)
GetDependentKeyValueFactory<TKey>()

根據從各種實體資料形式取得的外鍵值,建立索引鍵值的處理站。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

(繼承來源 IForeignKey)
GetNavigation(Boolean)

傳回與此外鍵相關聯的導覽。

GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

取得具有指定名稱的執行時間批註值,如果不存在,請加以新增。

(繼承來源 IAnnotatable)
GetReferencingSkipNavigations()

使用這個外鍵取得所有略過導覽。

GetRelatedEntityType(IReadOnlyEntityType)

取得與指定實體類型相關的實體類型。

GetRuntimeAnnotations()

取得目前 物件上的所有執行時間批註。

(繼承來源 IAnnotatable)
HasDependentToPrincipal(MemberInfo)
已過時。.

在指向主體實體的相依實體類型上設定導覽屬性。

HasDependentToPrincipal(PropertyInfo)

在指向主體實體的相依實體類型上設定導覽屬性。

HasDependentToPrincipal(String)
已過時。.

在指向主體實體的相依實體類型上設定導覽屬性。

HasPrincipalToDependent(MemberInfo)
已過時。.

在指向相依實體的主體實體類型上設定導覽屬性。

HasPrincipalToDependent(PropertyInfo)

在指向相依實體的主體實體類型上設定導覽屬性。

HasPrincipalToDependent(String)
已過時。.

在指向相依實體的主體實體類型上設定導覽屬性。

IsBaseLinking()

傳回值,指出外鍵是否定義在主鍵上,並指向相同的主鍵。

(繼承來源 IReadOnlyForeignKey)
RemoveAnnotation(String)

從這個 物件中移除指定的批註。

(繼承來源 IMutableAnnotatable)
RemoveRuntimeAnnotation(String)

從這個 物件中移除指定的執行時間批註。

(繼承來源 IAnnotatable)
SetAnnotation(String, Object)

設定儲存在指定索引鍵底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 IMutableAnnotatable)
SetDependentToPrincipal(MemberInfo)

在指向主體實體的相依實體類型上設定導覽屬性。

SetDependentToPrincipal(String)

在指向主體實體的相依實體類型上設定導覽屬性。

SetOrRemoveAnnotation(String, Object)

設定儲存在指定名稱底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。 如果 null 已提供,則會移除現有的批註。

(繼承來源 IMutableAnnotatable)
SetPrincipalToDependent(MemberInfo)

在指向相依實體的主體實體類型上設定導覽屬性。

SetPrincipalToDependent(String)

在指向相依實體的主體實體類型上設定導覽屬性。

SetProperties(IReadOnlyList<IMutableProperty>, IMutableKey)

設定外鍵屬性,以及該目標主體索引鍵。

SetRuntimeAnnotation(String, Object)

設定儲存在指定索引鍵底下的執行時間批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 IAnnotatable)
ToDebugString(MetadataDebugStringOptions, Int32)

建立人類可讀取的指定中繼資料標記法。

警告:不要依賴傳回字串的格式。 它專為偵錯而設計,而且可能會在發行之間任意變更。

(繼承來源 IReadOnlyForeignKey)

擴充方法

GetDependentKeyValueFactory<TKey>(IForeignKey)

根據從各種實體資料形式取得的外鍵值,建立索引鍵值的處理站。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

GetNavigation(IForeignKey, Boolean)

傳回與此外鍵相關聯的導覽。

GetRelatedEntityType(IForeignKey, IEntityType)

取得與指定實體類型相關的實體類型。

IsBaseLinking(IForeignKey)

傳回值,指出外鍵是否定義在主鍵上,並指向相同的主鍵。

ToDebugString(IForeignKey, MetadataDebugStringOptions, Int32)

建立人類可讀取的指定中繼資料標記法。

警告:不要依賴傳回字串的格式。 它專為偵錯而設計,而且可能會在發行之間任意變更。

AnnotationsToDebugString(IAnnotatable, Int32)

取得 物件上宣告之所有注釋的偵錯字串。

GetAnnotation(IAnnotatable, String)

取得具有指定名稱的注釋,如果不存在,則會擲回。

AddAnnotations(IMutableAnnotatable, IEnumerable<IAnnotation>)

將批註加入物件。

GetAnnotation(IMutableAnnotatable, String)

取得具有指定名稱的注釋,如果不存在,則會擲回。

GetOrAddAnnotation(IMutableAnnotatable, String, String)

取得具有指定索引鍵的現有注釋,如果不存在,則加入新的批註。

SetOrRemoveAnnotation(IMutableAnnotatable, String, Object)

設定儲存在指定名稱底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。 如果 null 已提供,則會移除現有的批註。

GetNavigation(IMutableForeignKey, Boolean)

傳回與此外鍵相關聯的導覽。

GetRelatedEntityType(IMutableForeignKey, IMutableEntityType)

取得與指定實體類型相關的實體類型。

FindSharedObjectRootForeignKey(IForeignKey, StoreObjectIdentifier)

尋找對應至共用資料表類似物件中相同條件約束的第一 IConventionForeignKey 個 。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

FindSharedObjectRootForeignKey(IMutableForeignKey, StoreObjectIdentifier)

尋找對應至共用資料表類似物件中相同條件約束的第一 IMutableForeignKey 個 。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

FindSharedObjectRootForeignKey(IReadOnlyForeignKey, StoreObjectIdentifier)

尋找對應至共用資料表類似物件中相同條件約束的第一 IForeignKey 個 。

這個方法通常由資料庫提供者使用, (和其他延伸模組) 。 它通常不會用於應用程式程式碼中。

GetConstraintName(IForeignKey)

傳回外鍵條件約束名稱。

GetConstraintName(IForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

傳回外鍵條件約束名稱。

GetConstraintName(IReadOnlyForeignKey)

傳回外鍵條件約束名稱。

GetConstraintName(IReadOnlyForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

傳回外鍵條件約束名稱。

GetDefaultName(IForeignKey)

傳回用於這個外鍵的預設條件約束名稱。

GetDefaultName(IForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

傳回用於這個外鍵的預設條件約束名稱。

GetDefaultName(IReadOnlyForeignKey)

傳回用於這個外鍵的預設條件約束名稱。

GetDefaultName(IReadOnlyForeignKey, StoreObjectIdentifier, StoreObjectIdentifier)

傳回用於這個外鍵的預設條件約束名稱。

GetMappedConstraints(IForeignKey)

取得外鍵所對應的外鍵條件約束。

IsRowInternal(IReadOnlyForeignKey, StoreObjectIdentifier)

傳回值,指出這個外鍵是否介於兩個共用相同類似資料表的存放區物件之實體類型之間。

SetConstraintName(IMutableForeignKey, String)

設定外鍵條件約束名稱。

Relational(IForeignKey)

取得外鍵的關係資料庫特定中繼資料。

Relational(IMutableForeignKey)

取得外鍵的關係資料庫特定中繼資料。

Sqlite(IForeignKey)

取得外鍵的 SQLite 特定中繼資料。

Sqlite(IMutableForeignKey)

取得外鍵的 SQLite 特定中繼資料。

SqlServer(IForeignKey)

取得外鍵SQL Server特定中繼資料。

SqlServer(IMutableForeignKey)

取得外鍵SQL Server特定中繼資料。

適用於