Class PrimaryKey
Represents the primary key of a database table. A primary key uniquely identifies each record in the table and enforces entity integrity within the database schema.
public class PrimaryKey : Key, IVisitorAcceptor, ICheckable
- Inheritance
-
PrimaryKey
- Implements
- Inherited Members
Constructors
PrimaryKey(Table, string, IEnumerable<string>)
Initializes a new instance of the PrimaryKey class.
public PrimaryKey(Table table, string name, IEnumerable<string> columnNames)
Parameters
tableTableThe table that owns the primary key.
namestringThe name of the primary key constraint.
columnNamesIEnumerable<string>The names of the columns that make up the primary key.
Properties
IsComputed
Gets a value indicating whether the primary key is computed.
public bool IsComputed { get; }
Property Value
IsIdentity
Gets a value indicating whether the primary key is an identity column.
public bool IsIdentity { get; }
Property Value
Methods
AcceptVisitor(IVisitor)
Accepts a visitor, allowing it to perform operations on the implementing class. The visitor will typically have specific methods for handling different types of elements in the object structure.
public override void AcceptVisitor(IVisitor visitor)
Parameters
visitorIVisitorThe visitor instance that will perform operations on the implementing class.