Skip to content

Define FK relationships in T4 .tt file? #3369

Closed Answered by MaceWindu
Pretagonist asked this question in Q&A
Discussion options

You must be logged in to vote

Before GenerateModel() call, which will generate code from loaded model you can modify it by adding association to table.
Check https://linq2db.github.io/articles/T4.html#useful-members-and-data-structures Table.ForeignKeys dictionary and ForeignKey class

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MaceWindu
Comment options

Answer selected by Pretagonist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants