RuntimeEntityType.AddIndex 方法

定义

向此实体类型添加索引。

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeIndex AddIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty> properties, string? name = default, bool unique = false);
abstract member AddIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty> * string * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeIndex
override this.AddIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty> * string * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeIndex
Public Overridable Function AddIndex (properties As IReadOnlyList(Of RuntimeProperty), Optional name As String = Nothing, Optional unique As Boolean = false) As RuntimeIndex

参数

properties
IReadOnlyList<RuntimeProperty>

要编制索引的属性。

name
String

索引的名称。

unique
Boolean

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

返回

新创建的索引。

适用于