Class Key
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
tableTableThe table that owns the key.
namestringThe name of the key.
columnNamesIEnumerable<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
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
otherKeyThe key to compare against the current key.
Returns
- bool
trueif the current key matches the signature of the specified key; otherwise,false.