C# Класс Framework.Migrator.Fluent.ForeignKey

Provides fluent interface for foreign key building. Reference is the name of relationship. Names of primary key table and column, foreign key column is generated by comvention using reference name, but can be overrided.

By default: Primary key table Reference name in singular form. Primary key column Default primary key name - Id. Foreign key column Reference name in singular form + Id. Foreign key name FK_ + Foreign Key Table + _ + Reference name in singular form.
Наследование: IMigrationPart, IColumn
Показать файл Открыть проект

Открытые методы

Метод Описание
Column ( String columnName ) : ForeignKey

Changes the name of foreign key column.

ForeignKey ( String reference, String foreignKeyTable ) : System

Initializes a new instance of the ForeignKey class.

GetColumn ( ) : ECM7.Migrator.Framework.Column

Gets the column specification.

Migrate ( ITransformationProvider database ) : void

Implementation of this method is speicific to operation kind (add foreign key and remove foreign key).

Named ( String foreignKeyName ) : ForeignKey

Changes the name of DeleteConstraint.

NotRequired ( ) : ForeignKey

Makes foreign key column not required.

OnDelete ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey

Changes the DeleteConstraint behaviour for delete.

OnUpdate ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey

Changes the DeleteConstraint behaviour for delete.

PrimaryKey ( String columnName ) : ForeignKey

Changes the name of primary key column.

Table ( String tableName ) : ForeignKey

Changes the name of primary key table.

Type ( DbType foreignKeyColumnType ) : ForeignKey

Sets the data type of foreign key column.

WithoutColumn ( ) : ForeignKey

Avoids foreign key column adding or removing.

Описание методов

Column() публичный Метод

Changes the name of foreign key column.
public Column ( String columnName ) : ForeignKey
columnName String Name of foreign key column.
Результат ForeignKey

ForeignKey() публичный Метод

Initializes a new instance of the ForeignKey class.
public ForeignKey ( String reference, String foreignKeyTable ) : System
reference String The reference.
foreignKeyTable String The foreign key table.
Результат System

GetColumn() публичный Метод

Gets the column specification.
public GetColumn ( ) : ECM7.Migrator.Framework.Column
Результат ECM7.Migrator.Framework.Column

Migrate() публичный Метод

Implementation of this method is speicific to operation kind (add foreign key and remove foreign key).
public Migrate ( ITransformationProvider database ) : void
database ITransformationProvider The database.
Результат void

Named() публичный Метод

Changes the name of DeleteConstraint.
public Named ( String foreignKeyName ) : ForeignKey
foreignKeyName String Name of DeleteConstraint.
Результат ForeignKey

NotRequired() публичный Метод

Makes foreign key column not required.
public NotRequired ( ) : ForeignKey
Результат ForeignKey

OnDelete() публичный Метод

Changes the DeleteConstraint behaviour for delete.
public OnDelete ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey
foreignKeyConstraint ECM7.Migrator.Framework.ForeignKeyConstraint DeleteConstraint behaviour.
Результат ForeignKey

OnUpdate() публичный Метод

Changes the DeleteConstraint behaviour for delete.
public OnUpdate ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey
foreignKeyConstraint ECM7.Migrator.Framework.ForeignKeyConstraint DeleteConstraint behaviour.
Результат ForeignKey

PrimaryKey() публичный Метод

Changes the name of primary key column.
public PrimaryKey ( String columnName ) : ForeignKey
columnName String Name of primary key column.
Результат ForeignKey

Table() публичный Метод

Changes the name of primary key table.
public Table ( String tableName ) : ForeignKey
tableName String Name of primary key table.
Результат ForeignKey

Type() публичный Метод

Sets the data type of foreign key column.
public Type ( DbType foreignKeyColumnType ) : ForeignKey
foreignKeyColumnType DbType Data type of foreign key column.
Результат ForeignKey

WithoutColumn() публичный Метод

Avoids foreign key column adding or removing.
public WithoutColumn ( ) : ForeignKey
Результат ForeignKey