Table of Contents

Class PrimaryKey

Namespace
LinqToDB.Schema
Assembly
linq2db.Tools.dll

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 string

Primary 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

IReadOnlyCollection<string>

Name

Primary key name.

public string? Name { get; init; }

Property Value

string

Methods

GetColumnPositionInKey(Column)

Gets position of specified column in primary key.

public int GetColumnPositionInKey(Column column)

Parameters

column Column

Primary 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.