共用方式為


DiscriminatorConvention 類別

定義

將階層中實體類型的辨別值設定為實體類型名稱的慣例。

public class DiscriminatorConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeRemovedConvention
public class DiscriminatorConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IDiscriminatorPropertySetConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeRemovedConvention
type DiscriminatorConvention = class
    interface IEntityTypeBaseTypeChangedConvention
    interface IConvention
    interface IEntityTypeRemovedConvention
type DiscriminatorConvention = class
    interface IEntityTypeBaseTypeChangedConvention
    interface IConvention
    interface IEntityTypeRemovedConvention
    interface IDiscriminatorPropertySetConvention
Public Class DiscriminatorConvention
Implements IEntityTypeBaseTypeChangedConvention, IEntityTypeRemovedConvention
Public Class DiscriminatorConvention
Implements IDiscriminatorPropertySetConvention, IEntityTypeBaseTypeChangedConvention, IEntityTypeRemovedConvention
繼承
DiscriminatorConvention
衍生
實作

備註

如需詳細資訊和範例,請參閱 模型建置慣例

建構函式

DiscriminatorConvention(ProviderConventionSetBuilderDependencies)

建立 DiscriminatorConvention 的新執行個體。

屬性

Dependencies

此服務的相依性。

方法

ProcessDiscriminatorPropertySet(IConventionEntityTypeBuilder, String, IConventionContext<String>)

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

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

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

ProcessEntityTypeRemoved(IConventionModelBuilder, IConventionEntityType, IConventionContext<IConventionEntityType>)

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

SetDefaultDiscriminatorValues(IEnumerable<IConventionEntityType>, IConventionDiscriminatorBuilder)

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

適用於