Class PrimaryKey
Table primary key constraint descriptor.
public sealed record PrimaryKey : IEquatable<PrimaryKey>
- Inheritance
-
PrimaryKey
- Implements
- Extension Methods
Constructors
PrimaryKey(string?, IReadOnlyCollection<string>)
Table primary key constraint descriptor.
public PrimaryKey(string? Name, IReadOnlyCollection<string> Columns)
Parameters
Name
stringPrimary key name.
Columns
IReadOnlyCollection<string>Primary key columns, ordered by constraint ordinal.
Properties
Columns
Primary key columns, ordered by constraint ordinal.
public IReadOnlyCollection<string> Columns { get; init; }
Property Value
Name
Primary key name.
public string? Name { get; init; }
Property Value
Methods
GetColumnPositionInKey(Column)
Gets position of specified column in primary key.
public int GetColumnPositionInKey(Column column)
Parameters
column
ColumnPrimary key column.
Returns
- int
Position (0-based ordinal) of column in primary key.
Exceptions
- InvalidOperationException
Provided column not found in primary key.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.