DbIndexInfo

Ecng.Data

Represents a single index discovered in a live database via CancellationToken). Composite indexes are surfaced as multiple rows — one per indexed column with a shared IndexName and ascending ColumnOrdinal. Primary-key, unique-constraint, and foreign-key backing indexes are included so the schema migrator can correctly skip them when comparing against entity-declared [Index] / [Unique] attributes.

Implementa: IEquatable<DbIndexInfo>

Constructores

DbIndexInfo
public DbIndexInfo(string IndexName, string TableName, string ColumnName, int ColumnOrdinal, bool IsUnique, bool IsPrimaryKey)
dbIndexInfo = DbIndexInfo(IndexName, TableName, ColumnName, ColumnOrdinal, IsUnique, IsPrimaryKey)

Represents a single index discovered in a live database via CancellationToken). Composite indexes are surfaced as multiple rows — one per indexed column with a shared IndexName and ascending ColumnOrdinal. Primary-key, unique-constraint, and foreign-key backing indexes are included so the schema migrator can correctly skip them when comparing against entity-declared [Index] / [Unique] attributes.

IndexName
Name of the index as stored by the database.
TableName
Name of the table the index belongs to.
ColumnName
Name of the indexed column.
ColumnOrdinal
1-based position of the column inside the index. Composite indexes report each member with its key position.
IsUnique
True when the index enforces uniqueness.
IsPrimaryKey
True when the index backs the table's primary key.

Propiedades

ColumnName
public string ColumnName { get; set; }
value = dbIndexInfo.ColumnName
dbIndexInfo.ColumnName = value

Name of the indexed column.

ColumnOrdinal
public int ColumnOrdinal { get; set; }
value = dbIndexInfo.ColumnOrdinal
dbIndexInfo.ColumnOrdinal = value

1-based position of the column inside the index. Composite indexes report each member with its key position.

IndexName
public string IndexName { get; set; }
value = dbIndexInfo.IndexName
dbIndexInfo.IndexName = value

Name of the index as stored by the database.

IsPrimaryKey
public bool IsPrimaryKey { get; set; }
value = dbIndexInfo.IsPrimaryKey
dbIndexInfo.IsPrimaryKey = value

True when the index backs the table's primary key.

IsUnique
public bool IsUnique { get; set; }
value = dbIndexInfo.IsUnique
dbIndexInfo.IsUnique = value

True when the index enforces uniqueness.

TableName
public string TableName { get; set; }
value = dbIndexInfo.TableName
dbIndexInfo.TableName = value

Name of the table the index belongs to.