語言

CosmosRelationshipDiscoveryConvention 類別

定義

一種約定,根據導航屬性配置實體類型間的關係,只要對應的反向導航沒有歧義。 所有導航皆假設是針對 Cosmos 擁有實體類型。

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

備註

更多資訊與範例請參閱模型建構慣例,以及使用 EF Core 存取 Azure Cosmos DB。

建構函式

名稱 Description
CosmosRelationshipDiscoveryConvention(ProviderConventionSetBuilderDependencies)

建立一個新的 實例。RelationshipDiscoveryConvention

屬性

名稱 Description
Dependencies

此服務的依賴關係。

(繼承來源 RelationshipDiscoveryConvention)
UseAttributes

一個表示慣例是否會使用成員身上屬性的值。

(繼承來源 RelationshipDiscoveryConvention)

方法

名稱 Description
DiscoverRelationships(IConventionEntityTypeBuilder, IConventionContext, Boolean)

發現該實體類型的關聯。

(繼承來源 RelationshipDiscoveryConvention)
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

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

(繼承來源 RelationshipDiscoveryConvention)
ProcessEntityTypeBaseTypeChanged(IConventionEntityTypeBuilder, IConventionEntityType, IConventionEntityType, IConventionContext<IConventionEntityType>)

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

(繼承來源 RelationshipDiscoveryConvention)
ProcessEntityTypeIgnored(IConventionModelBuilder, String, Type, IConventionContext<String>)

在忽略某個實體類型後呼叫。

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

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

(繼承來源 RelationshipDiscoveryConvention)
ProcessForeignKeyNullNavigationSet(IConventionForeignKeyBuilder, Boolean, IConventionContext<IConventionNavigation>)

在導航設定為 null 外鍵後呼叫。

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

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

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

在移除外金鑰後呼叫。

(繼承來源 RelationshipDiscoveryConvention)
ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)

在新增導航到實體類型後呼叫。

(繼承來源 RelationshipDiscoveryConvention)
ProcessNavigationRemoved(IConventionEntityTypeBuilder, IConventionEntityTypeBuilder, String, MemberInfo, IConventionContext<String>)

在從實體類型中移除導覽後呼叫。

(繼承來源 RelationshipDiscoveryConvention)
ProcessTypeIgnored(IConventionModelBuilder, String, Type, IConventionContext<String>)

在忽略某個實體類型後呼叫。

(繼承來源 RelationshipDiscoveryConvention)
ShouldBeOwned(Type, IConventionModel)

回傳一個值,表示如果該實體類型目前不在模型中,是否應該被加入為擁有。

ShouldBeOwnedType(Type, IConventionModel)

回傳一個值,表示如果該實體類型目前不在模型中,是否應該被加入為擁有。

TryGetTargetEntityTypeBuilder(IConventionEntityTypeBuilder, Type, MemberInfo, Nullable<Boolean>, Boolean)

尋找或嘗試為指定導航成員建立實體類型目標。

(繼承來源 RelationshipDiscoveryConvention)

適用於