Skip to content

CreateForeignKey Method ​

Definition ​

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

TableJoin CreateForeignKey(TableInfo targetTable, TableInfo rootTable, string alias, string logicalName, string rootAlias, string foreignKeyColumnOnRoot, JoinType joinType, string targetKeyColumn = null, IEnumerable<string> columns = null) ​

csharp
TableJoin CreateForeignKey(TableInfo targetTable, TableInfo rootTable, string alias, string logicalName, string rootAlias, string foreignKeyColumnOnRoot, JoinType joinType, string targetKeyColumn = null, IEnumerable<string> columns = null)

Creates a join from a root table foreign-key column to the target table primary key.

Parameters ​

NameDescription
aliasSQL alias for the joined table (for example, c).
columnsOptional columns to project from the joined table.
foreignKeyColumnOnRootFK column on the root table (property or column name).
joinTypeJOIN type to emit in SQL.
logicalNameLogical name used in query paths (for example, Customer).
rootAliasSQL alias for the root table (for example, o).
rootTableRoot table containing the foreign-key column.
targetKeyColumnPrimary key column on the target table; defaults to PrimaryKeyColumn.
targetTableTable being joined.