Skip to content

DmForeignKeyConstraint ​

Namespace: MJCZone.DapperMatic.Models

Assembly: MJCZone.DapperMatic

Summary ​

Represents a foreign key constraint in a database.

Inheritance ​

Base Class: DmConstraint

public

Contents ​

Constructors (3) | Methods (4) | Properties (10)

Constructors ​

DmForeignKeyConstraint ​

Initializes a new instance of the DmForeignKeyConstraint class. Used for deserialization.

csharp
DmForeignKeyConstraint()

DmForeignKeyConstraint ​

Initializes a new instance of the DmForeignKeyConstraint class. Used when schema name and table name are not necessary as when creating a table.

csharp
DmForeignKeyConstraint(
    string constraintName,
    DmOrderedColumn[] sourceColumns,
    string referencedTableName,
    DmOrderedColumn[] referencedColumns,
    DmForeignKeyAction onDelete,
    DmForeignKeyAction onUpdate)

Parameters ​

  • constraintName (string) - The desired name for the new foreign key constraint.

  • sourceColumns (DmOrderedColumn[]) - An array of DmOrderedColumn objects representing the columns in the source table that are part of the foreign key.

  • referencedTableName (string) - The name of the table that is referenced by the foreign key constraint.

  • referencedColumns (DmOrderedColumn[]) - An array of DmOrderedColumn objects representing the columns in the referenced table that correspond to the source columns.

  • onDelete (DmForeignKeyAction) - .

  • onUpdate (DmForeignKeyAction) - .

DmForeignKeyConstraint ​

Initializes a new instance of the DmForeignKeyConstraint class.

csharp
DmForeignKeyConstraint(
    string schemaName,
    string tableName,
    string constraintName,
    DmOrderedColumn[] sourceColumns,
    string referencedTableName,
    DmOrderedColumn[] referencedColumns,
    DmForeignKeyAction onDelete,
    DmForeignKeyAction onUpdate)

Parameters ​

  • schemaName (string) - The name of the schema containing the table with the foreign key constraint. Can be null if not specified, indicating the default schema.

  • tableName (string) - The name of the table that contains the foreign key constraint.

  • constraintName (string) - The desired name for the new foreign key constraint.

  • sourceColumns (DmOrderedColumn[]) - An array of DmOrderedColumn objects representing the columns in the source table that are part of the foreign key.

  • referencedTableName (string) - The name of the table that is referenced by the foreign key constraint.

  • referencedColumns (DmOrderedColumn[]) - An array of DmOrderedColumn objects representing the columns in the referenced table that correspond to the source columns.

  • onDelete (DmForeignKeyAction) - .

  • onUpdate (DmForeignKeyAction) - .

Methods ​

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()

Properties ​

SchemaName ​

Gets or sets the schema name.

Type: string?

TableName ​

Gets or sets the table name.

Type: string

SourceColumns ​

Gets or sets the source columns.

Type: List<DmOrderedColumn>

ReferencedTableName ​

Gets or sets the referenced table name.

Type: string

ReferencedColumns ​

Gets or sets the referenced columns.

Type: List<DmOrderedColumn>

OnDelete ​

Gets or sets the action on delete.

Type: DmForeignKeyAction

OnUpdate ​

Gets or sets the action on update.

Type: DmForeignKeyAction

ConstraintType ​

Gets the constraint type.

Type: DmConstraintType

ConstraintName ​

Gets or sets the name of the constraint.

Type: object

PreviousNames ​

Gets or sets the names this constraint has had before, most recent first.

Type: object