ForeignKeyIndexConvention 类

定义

对外键属性创建索引的约定,除非现有索引或键已涵盖外键属性。

public class ForeignKeyIndexConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention
public class ForeignKeyIndexConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPropertiesChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IIndexUniquenessChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention
type ForeignKeyIndexConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface IForeignKeyRemovedConvention
    interface IForeignKeyPropertiesChangedConvention
    interface IForeignKeyUniquenessChangedConvention
    interface IKeyAddedConvention
    interface IKeyRemovedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IIndexAddedConvention
    interface IIndexRemovedConvention
    interface IIndexUniquenessChangedConvention
    interface IModelFinalizedConvention
type ForeignKeyIndexConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface IForeignKeyRemovedConvention
    interface IForeignKeyPropertiesChangedConvention
    interface IForeignKeyUniquenessChangedConvention
    interface IKeyAddedConvention
    interface IKeyRemovedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IIndexAddedConvention
    interface IIndexRemovedConvention
    interface IIndexUniquenessChangedConvention
    interface IModelFinalizingConvention
Public Class ForeignKeyIndexConvention
Implements IEntityTypeBaseTypeChangedConvention, IForeignKeyAddedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRemovedConvention, IForeignKeyUniquenessChangedConvention, IIndexAddedConvention, IIndexRemovedConvention, IIndexUniquenessChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelFinalizedConvention
Public Class ForeignKeyIndexConvention
Implements IEntityTypeBaseTypeChangedConvention, IForeignKeyAddedConvention, IForeignKeyPropertiesChangedConvention, IForeignKeyRemovedConvention, IForeignKeyUniquenessChangedConvention, IIndexAddedConvention, IIndexRemovedConvention, IIndexUniquenessChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelFinalizingConvention
继承
ForeignKeyIndexConvention
实现

注解

有关详细信息和示例,请参阅 模型生成约定

构造函数

ForeignKeyIndexConvention(ProviderConventionSetBuilderDependencies)

创建 ForeignKeyIndexConvention 的新实例。

属性

Dependencies

此服务的依赖项。

方法

AreIndexedBy(IReadOnlyList<IConventionProperty>, Boolean, IReadOnlyList<IConventionProperty>, Boolean)

返回一个值,该值指示给定属性是否已由现有索引覆盖。

CreateIndex(IReadOnlyList<IConventionProperty>, Boolean, IConventionEntityTypeBuilder)

创建 IConventionIndex

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

在实体类型的基类型更改后调用。

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

在将外键添加到实体类型后调用。

ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在将外键添加到实体类型后调用。

ProcessForeignKeyPropertiesChanged(IConventionForeignKeyBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IReadOnlyList<IConventionProperty>>)

在更改外键属性或主体键后调用。

ProcessForeignKeyPropertiesChanged(IConventionRelationshipBuilder, IReadOnlyList<IConventionProperty>, IConventionKey, IConventionContext<IConventionRelationshipBuilder>)

在更改外键属性或主体键后调用。

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

在删除外键后调用。

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

在更改外键的唯一性后调用。

ProcessForeignKeyUniquenessChanged(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在更改外键的唯一性后调用。

ProcessIndexAdded(IConventionIndexBuilder, IConventionContext<IConventionIndexBuilder>)

在将索引添加到实体类型后调用。

ProcessIndexRemoved(IConventionEntityTypeBuilder, IConventionIndex, IConventionContext<IConventionIndex>)

在删除索引后调用。

ProcessIndexUniquenessChanged(IConventionIndexBuilder, IConventionContext<IConventionIndexBuilder>)

在索引的唯一性更改后调用。

ProcessIndexUniquenessChanged(IConventionIndexBuilder, IConventionContext<Nullable<Boolean>>)

在索引的唯一性更改后调用。

ProcessKeyAdded(IConventionKeyBuilder, IConventionContext<IConventionKeyBuilder>)

在将键添加到实体类型后调用。

ProcessKeyRemoved(IConventionEntityTypeBuilder, IConventionKey, IConventionContext<IConventionKey>)

从实体类型中删除键后调用。

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在模型最终确定后调用。

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在最终确定模型时调用。

适用于