Appearance
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
| Name | Description |
|---|---|
alias | SQL alias for the joined table (for example, c). |
columns | Optional columns to project from the joined table. |
foreignKeyColumnOnRoot | FK column on the root table (property or column name). |
joinType | JOIN type to emit in SQL. |
logicalName | Logical name used in query paths (for example, Customer). |
rootAlias | SQL alias for the root table (for example, o). |
rootTable | Root table containing the foreign-key column. |
targetKeyColumn | Primary key column on the target table; defaults to PrimaryKeyColumn. |
targetTable | Table being joined. |