共用方式為


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

值,指出指派給索引屬性的值是否是唯一的。

傳回

新建立的索引。

適用於