MutableEntityTypeExtensions.GetOrAddIndex 方法

定义

重载

GetOrAddIndex(IMutableEntityType, IMutableProperty)

获取在给定属性上定义的索引,如果尚未定义索引,则创建一个新索引。

GetOrAddIndex(IMutableEntityType, IReadOnlyList<IMutableProperty>)

获取在给定属性上定义的索引,如果尚未定义索引,则创建一个新索引。

GetOrAddIndex(IMutableEntityType, IMutableProperty)

获取在给定属性上定义的索引,如果尚未定义索引,则创建一个新索引。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableIndex GetOrAddIndex (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property);
static member GetOrAddIndex : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * Microsoft.EntityFrameworkCore.Metadata.IMutableProperty -> Microsoft.EntityFrameworkCore.Metadata.IMutableIndex
<Extension()>
Public Function GetOrAddIndex (entityType As IMutableEntityType, property As IMutableProperty) As IMutableIndex

参数

entityType
IMutableEntityType

要获取索引或向其添加索引的实体类型。

property
IMutableProperty

要编制索引的属性。

返回

现有索引或新创建的索引。

适用于

GetOrAddIndex(IMutableEntityType, IReadOnlyList<IMutableProperty>)

获取在给定属性上定义的索引,如果尚未定义索引,则创建一个新索引。

public static Microsoft.EntityFrameworkCore.Metadata.IMutableIndex GetOrAddIndex (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> properties);
static member GetOrAddIndex : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IMutableProperty> -> Microsoft.EntityFrameworkCore.Metadata.IMutableIndex
<Extension()>
Public Function GetOrAddIndex (entityType As IMutableEntityType, properties As IReadOnlyList(Of IMutableProperty)) As IMutableIndex

参数

entityType
IMutableEntityType

要获取索引或向其添加索引的实体类型。

properties
IReadOnlyList<IMutableProperty>

要编制索引的属性。

返回

现有索引或新创建的索引。

适用于