Define FK relationships in T4 .tt file? #3369
-
I'm working against a legacy database that I'm not really interested in modifying. There are a couple of relationships that aren't defined in the DB scheme but I want the T4 system to generate them anyway. Is there any way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
MaceWindu
Nov 29, 2021
Replies: 1 comment 1 reply
-
Before |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Pretagonist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 andForeignKey
class