Share via


IConventionIndex 接口

定义

表示一组属性上的索引。

public interface IConventionIndex : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IIndex
public interface IConventionIndex : Microsoft.EntityFrameworkCore.Metadata.IConventionAnnotatable, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyIndex
type IConventionIndex = interface
    interface IIndex
    interface IAnnotatable
    interface IConventionAnnotatable
type IConventionIndex = interface
    interface IReadOnlyIndex
    interface IReadOnlyAnnotatable
    interface IConventionAnnotatable
Public Interface IConventionIndex
Implements IConventionAnnotatable, IIndex
Public Interface IConventionIndex
Implements IConventionAnnotatable, IReadOnlyIndex
实现

注解

此接口在模型创建期间使用,并允许修改元数据。 生成模型后, IIndex 表示相同元数据的只读视图。

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

属性

Builder

获取可用于配置此索引的生成器。

DeclaringEntityType

获取定义索引的实体类型。 这可能不同于在继承层次结构中定义索引为派生类型时定义的类型 Properties (,因为属性可以在基类型) 上定义。

IsDescending

一组值,指示每个相应的索引列是否具有降序排序顺序。

(继承自 IReadOnlyIndex)
IsInModel

指示此对象是否在模型中,即尚未从模型中删除。

(继承自 IConventionAnnotatable)
IsUnique

获取一个值,该值指示分配给索引属性的值是否唯一。

(继承自 IReadOnlyIndex)
Item[String]

获取具有给定名称的批注的值,如果不存在,则返回 null

(继承自 IReadOnlyAnnotatable)
Name

获取此索引的名称。

(继承自 IReadOnlyIndex)
Properties

获取定义此索引的属性。

方法

AddAnnotation(String, Object, Boolean)

向此对象添加批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 IConventionAnnotatable)
AddAnnotations(IEnumerable<IConventionAnnotation>, Boolean)

向 对象添加批注。

(继承自 IConventionAnnotatable)
AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果已存在具有指定名称的批注,则引发 。

(继承自 IAnnotatable)
AnnotationsToDebugString(Int32)

获取对象上声明的所有注释的调试字符串。

(继承自 IReadOnlyAnnotatable)
DisplayName()

获取给定 IReadOnlyIndex的友好显示名称,如果定义了 ,则返回 其 Name ;如果这是未命名的索引,则返回 其 Properties 的字符串表示形式。

(继承自 IReadOnlyIndex)
FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则返回 null

(继承自 IReadOnlyAnnotatable)
FindRuntimeAnnotation(String)

获取具有给定名称的运行时注释,如果不存在,则返回 null

(继承自 IAnnotatable)
FindRuntimeAnnotationValue(String)

获取具有给定名称的运行时注释的值,如果不存在,则返回 null

(继承自 IAnnotatable)
GetAnnotation(String)

获取具有给定名称的批注,如果不存在,则引发该批注。

(继承自 IReadOnlyAnnotatable)
GetAnnotations()

获取当前 对象上的所有注释。

(继承自 IReadOnlyAnnotatable)
GetConfigurationSource()

返回此索引的配置源。

GetIsDescendingConfigurationSource()

返回 的配置 IsDescending源。

GetIsUniqueConfigurationSource()

返回 的配置 IsUnique源。

GetNullableValueFactory<TKey>()

根据从各种实体数据形式的索引键值获取键值的工厂。

此方法通常由数据库提供程序 (和其他扩展) 使用。 它通常不在应用程序代码中使用。

(继承自 IIndex)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

获取具有给定名称的运行时注释的值,如果不存在,则添加该值。

(继承自 IAnnotatable)
GetRuntimeAnnotations()

获取当前 对象上的所有运行时注释。

(继承自 IAnnotatable)
RemoveAnnotation(String)

从此 对象中删除具有给定名称的批注。

(继承自 IConventionAnnotatable)
RemoveRuntimeAnnotation(String)

从此 对象中删除给定的运行时批注。

(继承自 IAnnotatable)
SetAnnotation(String, Object, Boolean)

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 IConventionAnnotatable)
SetIsDescending(IReadOnlyList<Boolean>, Boolean)

设置此索引的排序顺序 () (升序或降序) 。

SetIsUnique(Nullable<Boolean>, Boolean)

设置一个值,该值指示分配给索引属性的值是否唯一。

SetOrRemoveAnnotation(String, Object, Boolean)

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。 如果 null 提供了 ,则删除现有批注。

(继承自 IConventionAnnotatable)
SetRuntimeAnnotation(String, Object)

设置存储在给定键下的运行时注释。 如果具有指定名称的批注已存在,则覆盖现有批注。

(继承自 IAnnotatable)
ToDebugString(MetadataDebugStringOptions, Int32)

创建给定元数据的可读表示形式。

警告:不要依赖于返回的字符串的格式。 它仅用于调试,并且可能会在版本之间任意更改。

(继承自 IReadOnlyIndex)

扩展方法

AddAnnotations(IConventionAnnotatable, IEnumerable<IConventionAnnotation>, Boolean)

向 对象添加批注。

GetAnnotation(IConventionAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

SetOrRemoveAnnotation(IConventionAnnotatable, String, Object, Boolean)

设置存储在给定名称下的批注。 如果具有指定名称的批注已存在,则覆盖现有批注。 如果 null 提供了 ,则删除现有批注。

GetNullableValueFactory<TKey>(IIndex)

根据从各种实体数据形式的索引键值获取键值的工厂。

此方法通常由数据库提供程序 (和其他扩展) 使用。 它通常不在应用程序代码中使用。

ToDebugString(IIndex, MetadataDebugStringOptions, Int32)

创建给定元数据的可读表示形式。

警告:不要依赖于返回的字符串的格式。 它仅用于调试,并且可能会在版本之间任意更改。

AnnotationsToDebugString(IAnnotatable, Int32)

获取对象上声明的所有注释的调试字符串。

GetAnnotation(IAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

FindSharedObjectRootIndex(IConventionIndex, StoreObjectIdentifier)

查找映射到类似共享表的 对象中的同一索引的第 IConventionIndex 一个 。

此方法通常由数据库提供程序 (和其他扩展) 使用。 它通常不在应用程序代码中使用。

FindSharedObjectRootIndex(IIndex, StoreObjectIdentifier)

查找映射到类似共享表的 对象中的同一索引的第 IConventionIndex 一个 。

此方法通常由数据库提供程序 (和其他扩展) 使用。 它通常不在应用程序代码中使用。

FindSharedObjectRootIndex(IReadOnlyIndex, StoreObjectIdentifier)

查找映射到类似共享表的 对象中的同一索引的第 IIndex 一个 。

此方法通常由数据库提供程序 (和其他扩展) 使用。 它通常不在应用程序代码中使用。

GetDatabaseName(IIndex)

返回数据库中索引的名称。

GetDatabaseName(IIndex, StoreObjectIdentifier)

返回数据库中索引的名称。

GetDatabaseName(IReadOnlyIndex)

返回数据库中索引的名称。

GetDatabaseName(IReadOnlyIndex, StoreObjectIdentifier)

返回数据库中索引的名称。

GetDatabaseNameConfigurationSource(IConventionIndex)

获取 ConfigurationSource 数据库中索引的名称的 。

GetDefaultDatabaseName(IIndex)

返回将用于此索引的默认名称。

GetDefaultDatabaseName(IIndex, StoreObjectIdentifier)

返回将用于此索引的默认名称。

GetDefaultDatabaseName(IReadOnlyIndex)

返回将用于此索引的默认名称。

GetDefaultDatabaseName(IReadOnlyIndex, StoreObjectIdentifier)

返回将用于此索引的默认名称。

GetDefaultName(IIndex)
已过时。.

返回将用于此索引的默认名称。

GetFilter(IIndex)

返回索引筛选器表达式。

GetFilter(IIndex, StoreObjectIdentifier)

返回索引筛选器表达式。

GetFilter(IReadOnlyIndex)

返回索引筛选器表达式。

GetFilter(IReadOnlyIndex, StoreObjectIdentifier)

返回索引筛选器表达式。

GetFilterConfigurationSource(IConventionIndex)

ConfigurationSource获取索引筛选器表达式的 。

GetMappedTableIndexes(IIndex)

获取索引映射到的表索引。

GetName(IIndex)
已过时。.

返回数据库中索引的名称。

GetNameConfigurationSource(IConventionIndex)
已过时。.

获取 ConfigurationSource 数据库中索引的名称的 。

SetDatabaseName(IConventionIndex, String, Boolean)

设置数据库中索引的名称。

SetFilter(IConventionIndex, String, Boolean)

设置索引筛选器表达式。

SetName(IConventionIndex, String, Boolean)
已过时。.

设置数据库中索引的名称。

GetDataCompression(IReadOnlyIndex)

返回索引使用的数据压缩。

GetDataCompression(IReadOnlyIndex, StoreObjectIdentifier)

返回索引使用的数据压缩。

GetDataCompressionConfigurationSource(IConventionIndex)

返回 ConfigurationSource 索引使用的数据压缩的 。

GetFillFactor(IIndex)

返回一个值,该值指示索引是否使用填充因子。

GetFillFactor(IReadOnlyIndex)

返回索引使用的填充因子。

GetFillFactor(IReadOnlyIndex, StoreObjectIdentifier)

返回索引使用的填充因子。

GetFillFactorConfigurationSource(IConventionIndex)

返回 ConfigurationSource 索引是否使用填充因子的 。

GetIncludeProperties(IIndex)

如果尚未指定属性名称,则返回包含的属性名称或 null

GetIncludeProperties(IReadOnlyIndex)

如果尚未指定属性名称,则返回包含的属性名称或 null

GetIncludeProperties(IReadOnlyIndex, StoreObjectIdentifier)

如果尚未指定属性名称,则返回包含的属性名称或 null

GetIncludePropertiesConfigurationSource(IConventionIndex)

返回 ConfigurationSource 包含的属性名称的 。

GetIsClusteredConfigurationSource(IConventionIndex)

返回 ConfigurationSource 是否聚集索引的 。

GetIsCreatedOnlineConfigurationSource(IConventionIndex)

返回 ConfigurationSource 索引是否联机的 。

GetSortInTempDb(IReadOnlyIndex)

返回一个值,该值指示索引是否在 tempdb 中排序。

GetSortInTempDb(IReadOnlyIndex, StoreObjectIdentifier)

返回一个值,该值指示索引是否在 tempdb 中排序。

GetSortInTempDbConfigurationSource(IConventionIndex)

返回 ConfigurationSource 是否在 tempdb 中对索引进行排序的 。

IsClustered(IIndex)

返回一个值,该值指示索引是否为聚集索引。

IsClustered(IIndex, StoreObjectIdentifier)

返回一个值,该值指示索引是否为聚集索引。

IsClustered(IReadOnlyIndex)

返回一个值,该值指示索引是否为聚集索引。

IsClustered(IReadOnlyIndex, StoreObjectIdentifier)

返回一个值,该值指示索引是否为聚集索引。

IsCreatedOnline(IIndex)

返回一个值,该值指示索引是否联机。

IsCreatedOnline(IReadOnlyIndex)

返回一个值,该值指示索引是否联机。

IsCreatedOnline(IReadOnlyIndex, StoreObjectIdentifier)

返回一个值,该值指示索引是否联机。

SetDataCompression(IConventionIndex, Nullable<DataCompressionType>, Boolean)

设置一个值,该值指示索引使用的数据压缩。

SetFillFactor(IConventionIndex, Nullable<Int32>, Boolean)

定义一个值,该值指示索引是否使用填充因子。

SetIncludeProperties(IConventionIndex, IReadOnlyList<String>, Boolean)

设置包含的属性名称。

SetIsClustered(IConventionIndex, Nullable<Boolean>, Boolean)

设置一个值,该值指示索引是否聚集。

SetIsCreatedOnline(IConventionIndex, Nullable<Boolean>, Boolean)

设置一个值,该值指示索引是否处于联机状态。

SetSortInTempDb(IConventionIndex, Nullable<Boolean>, Boolean)

设置一个值,该值指示索引是否在 tempdb 中排序。

适用于