Table of Contents

Class OdfSchemaForeignKey

Namespace
OdfKit.Database
Assembly
OdfKit.dll

Represents a foreign key relationship definition model. 表示外鍵關聯定義模型。

public sealed class OdfSchemaForeignKey
Inheritance
OdfSchemaForeignKey
Inherited Members

Constructors

OdfSchemaForeignKey(string?, string, IEnumerable<OdfSchemaKeyMapping>)

Short overload of OdfSchemaForeignKey that accepts name, referencedTable, and keyColumns; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 name、referencedTable 與 keyColumns;其餘可選參數使用預設值並轉呼叫最長 OdfSchemaForeignKey 多載。

public OdfSchemaForeignKey(string? name, string referencedTable, IEnumerable<OdfSchemaKeyMapping> keyColumns)

Parameters

name string
referencedTable string
keyColumns IEnumerable<OdfSchemaKeyMapping>

OdfSchemaForeignKey(string?, string, IEnumerable<OdfSchemaKeyMapping>, string?)

Short overload of OdfSchemaForeignKey that accepts name, referencedTable, keyColumns, and updateRule; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 name、referencedTable、keyColumns 與 updateRule;其餘可選參數使用預設值並轉呼叫最長 OdfSchemaForeignKey 多載。

public OdfSchemaForeignKey(string? name, string referencedTable, IEnumerable<OdfSchemaKeyMapping> keyColumns, string? updateRule)

Parameters

name string
referencedTable string
keyColumns IEnumerable<OdfSchemaKeyMapping>
updateRule string

OdfSchemaForeignKey(string?, string, IEnumerable<OdfSchemaKeyMapping>, string?, string?)

Initializes a new instance of the OdfSchemaForeignKey class. 初始化 OdfSchemaForeignKey 類別的新執行個體。

public OdfSchemaForeignKey(string? name, string referencedTable, IEnumerable<OdfSchemaKeyMapping> keyColumns, string? updateRule, string? deleteRule)

Parameters

name string

The foreign key constraint name. / 外鍵約束名稱。

referencedTable string

The name of the referenced target table. / 被參照的目標資料表名稱。

keyColumns IEnumerable<OdfSchemaKeyMapping>

The list of foreign-key-to-primary-key column mappings. / 外鍵與主鍵欄位對應清單。

updateRule string

The update rule. / 更新規則。

deleteRule string

The delete rule. / 刪除規則。

Exceptions

ArgumentException

When referencedTable is empty. / 當 referencedTable 為空時擲出。

ArgumentNullException

When keyColumns is null. / 當 keyColumnsnull 時擲出。

Properties

DeleteRule

Gets the delete rule. 取得刪除規則。

public string? DeleteRule { get; }

Property Value

string

KeyColumns

Gets the list of foreign-key-to-primary-key column mappings. 取得外鍵與主鍵欄位的對應清單。

public List<OdfSchemaKeyMapping> KeyColumns { get; }

Property Value

List<OdfSchemaKeyMapping>

Name

Gets the foreign key constraint name. 取得外鍵約束名稱。

public string? Name { get; }

Property Value

string

ReferencedTable

Gets the name of the referenced target table. 取得被參照的目標資料表名稱。

public string ReferencedTable { get; }

Property Value

string

UpdateRule

Gets the update rule. 取得更新規則。

public string? UpdateRule { get; }

Property Value

string