Table of Contents

Interface IReadOnlyIndex

Namespace
Microsoft.EntityFrameworkCore.Metadata
Assembly
Microsoft.EntityFrameworkCore.dll

Represents an index on a set of properties.

public interface IReadOnlyIndex : IReadOnlyAnnotatable
Inherited Members

Remarks

See Modeling entity types and relationships for more information and examples.

Properties

DeclaringEntityType

Gets the entity type the index is defined on. This may be different from the type that Properties are defined on when the index is defined a derived type in an inheritance hierarchy (since the properties may be defined on a base type).

IReadOnlyEntityType DeclaringEntityType { get; }

Property Value

IReadOnlyEntityType

IsDescending

A set of values indicating whether each corresponding index column has descending sort order.

IReadOnlyList<bool>? IsDescending { get; }

Property Value

IReadOnlyList<bool>

IsUnique

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

bool IsUnique { get; }

Property Value

bool

Name

Gets the name of this index.

string? Name { get; }

Property Value

string

Properties

Gets the properties that this index is defined on.

IReadOnlyList<IReadOnlyProperty> Properties { get; }

Property Value

IReadOnlyList<IReadOnlyProperty>

Methods

DisplayName()

Gets the friendly display name for the given IReadOnlyIndex, returning its Name if one is defined, or a string representation of its Properties if this is an unnamed index.

string DisplayName()

Returns

string

The display name.

ToDebugString(MetadataDebugStringOptions, int)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

string ToDebugString(MetadataDebugStringOptions options = MetadataDebugStringOptions.ShortDefault, int indent = 0)

Parameters

options MetadataDebugStringOptions

Options for generating the string.

indent int

The number of indent spaces to use before each new line.

Returns

string

A human-readable representation.