C# Class 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.
Inheritance: IMigrationPart, IColumn
Afficher le fichier Open project: coreframework/Core-Framework

Méthodes publiques

Méthode Description
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.

Method Details

Column() public méthode

Changes the name of foreign key column.
public Column ( String columnName ) : ForeignKey
columnName String Name of foreign key column.
Résultat ForeignKey

ForeignKey() public méthode

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.
Résultat System

GetColumn() public méthode

Gets the column specification.
public GetColumn ( ) : ECM7.Migrator.Framework.Column
Résultat ECM7.Migrator.Framework.Column

Migrate() public méthode

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.
Résultat void

Named() public méthode

Changes the name of DeleteConstraint.
public Named ( String foreignKeyName ) : ForeignKey
foreignKeyName String Name of DeleteConstraint.
Résultat ForeignKey

NotRequired() public méthode

Makes foreign key column not required.
public NotRequired ( ) : ForeignKey
Résultat ForeignKey

OnDelete() public méthode

Changes the DeleteConstraint behaviour for delete.
public OnDelete ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey
foreignKeyConstraint ECM7.Migrator.Framework.ForeignKeyConstraint DeleteConstraint behaviour.
Résultat ForeignKey

OnUpdate() public méthode

Changes the DeleteConstraint behaviour for delete.
public OnUpdate ( ECM7.Migrator.Framework.ForeignKeyConstraint foreignKeyConstraint ) : ForeignKey
foreignKeyConstraint ECM7.Migrator.Framework.ForeignKeyConstraint DeleteConstraint behaviour.
Résultat ForeignKey

PrimaryKey() public méthode

Changes the name of primary key column.
public PrimaryKey ( String columnName ) : ForeignKey
columnName String Name of primary key column.
Résultat ForeignKey

Table() public méthode

Changes the name of primary key table.
public Table ( String tableName ) : ForeignKey
tableName String Name of primary key table.
Résultat ForeignKey

Type() public méthode

Sets the data type of foreign key column.
public Type ( DbType foreignKeyColumnType ) : ForeignKey
foreignKeyColumnType DbType Data type of foreign key column.
Résultat ForeignKey

WithoutColumn() public méthode

Avoids foreign key column adding or removing.
public WithoutColumn ( ) : ForeignKey
Résultat ForeignKey