共用方式為


CosmosDiscriminatorConvention 類別

定義

將實體類型的鑒別子值設定為實體類型名稱的慣例。

public class CosmosDiscriminatorConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.DiscriminatorConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention
public class CosmosDiscriminatorConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.DiscriminatorConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention
public class CosmosDiscriminatorConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.DiscriminatorConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention
type CosmosDiscriminatorConvention = class
    inherit DiscriminatorConvention
    interface IEntityTypeAddedConvention
    interface IConvention
type CosmosDiscriminatorConvention = class
    inherit DiscriminatorConvention
    interface IForeignKeyOwnershipChangedConvention
    interface IConvention
    interface IForeignKeyRemovedConvention
    interface IEntityTypeAddedConvention
type CosmosDiscriminatorConvention = class
    inherit DiscriminatorConvention
    interface IForeignKeyOwnershipChangedConvention
    interface IConvention
    interface IForeignKeyRemovedConvention
    interface IEntityTypeAddedConvention
    interface IEntityTypeAnnotationChangedConvention
Public Class CosmosDiscriminatorConvention
Inherits DiscriminatorConvention
Implements IEntityTypeAddedConvention
Public Class CosmosDiscriminatorConvention
Inherits DiscriminatorConvention
Implements IEntityTypeAddedConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyRemovedConvention
Public Class CosmosDiscriminatorConvention
Inherits DiscriminatorConvention
Implements IEntityTypeAddedConvention, IEntityTypeAnnotationChangedConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyRemovedConvention
繼承
CosmosDiscriminatorConvention
實作

備註

如需詳細資訊和範例,請參閱 模型建置慣例使用 EF Core 存取 Azure Cosmos DB

建構函式

CosmosDiscriminatorConvention(ProviderConventionSetBuilderDependencies)

建立 CosmosDiscriminatorConvention 的新執行個體。

屬性

Dependencies

此服務的相依性。

(繼承來源 DiscriminatorConvention)

方法

ProcessDiscriminatorPropertySet(IConventionEntityTypeBuilder, String, IConventionContext<String>)

將實體類型的鑒別子值設定為實體類型名稱的慣例。

ProcessDiscriminatorPropertySet(IConventionEntityTypeBuilder, String, IConventionContext<String>)

在設定鑒別子屬性之後呼叫。

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

在實體類型新增至模型之後呼叫。

ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

在實體類型上變更批註之後呼叫。

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

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

ProcessEntityTypeRemoved(IConventionModelBuilder, IConventionEntityType, IConventionContext<IConventionEntityType>)

從模型中移除實體類型之後呼叫。

ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

在外鍵的擁有權值變更之後呼叫。

ProcessForeignKeyOwnershipChanged(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在外鍵的擁有權值變更之後呼叫。

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

移除外鍵之後呼叫。

SetDefaultDiscriminatorValues(IEnumerable<IConventionEntityType>, IConventionDiscriminatorBuilder)

設定指定實體類型的鑒別子值。

SetDefaultDiscriminatorValues(IEnumerable<IConventionEntityType>, IConventionDiscriminatorBuilder)

設定指定實體類型的鑒別子值。

(繼承來源 DiscriminatorConvention)

適用於