Class Key

Namespace
DbExport.Schema
Assembly
DbExport.Api.dll

Represents an abstract base class for database keys, such as primary keys, foreign keys, and indexes. Provides functionality to manage columns associated with the key and to compare key signatures.

public abstract class Key : ColumnSet, IVisitorAcceptor, ICheckable
Inheritance
Key
Implements
Derived
Inherited Members

Constructors

Key(Table, string, IEnumerable<string>)

Initializes a new instance of the Key class.

protected Key(Table table, string name, IEnumerable<string> columnNames)

Parameters

table Table

The table that owns the key.

name string

The name of the key.

columnNames IEnumerable<string>

The names of the columns that make up the key.

Properties

Table

Gets the table that owns the key.

public Table Table { get; }

Property Value

Table

Methods

MatchesSignature(Key)

Determines whether the current key matches the signature of another key. A signature match occurs when both keys have the same number of columns and the columns have identical names in the same order.

public bool MatchesSignature(Key other)

Parameters

other Key

The key to compare against the current key.

Returns

bool

true if the current key matches the signature of the specified key; otherwise, false.