Share via


RuntimeEntityType.AddIndex Method

Definition

Adds an index to this entity type.

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

Parameters

properties
IReadOnlyList<RuntimeProperty>

The properties that are to be indexed.

name
String

The name of the index.

unique
Boolean

A value indicating whether the values assigned to the indexed properties are unique.

Returns

The newly created index.

Applies to