4

I'm up to speed with code first migrations and my project has evolved over several months to the stage where there are already dozens of migrations and I expect dozens more before the project closes.

Each time I use package manager to add a migration I need to make the same edits to the generated class (specifically to change out the boilerplate "dbo." to something held as a global var looked from config up using a helper, so I need to add a line of code to up() and down(), add a 'using' statement (move the usings to the top of the file) and replace all the dbo. in the generated names.)

I'm sure this is something I could do in the T4 template or whatever, and get the migration class generated with these edits already made, but where is the source?

Brian Lowe
  • 4,943
  • 1
  • 18
  • 20

0 Answers0