Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize Context filename when using Entity Framework Power Tools Reverse Engineering

When I generate the Context using EF Power Tools reverse engineering, it created a class with my DB name in a file with my DB name. I was able to modify the T4 template to use a static name for the Context class name. However, I'd like to use the same static name with the class's filename. How can I do this?

like image 296
Mike Cole Avatar asked Apr 25 '13 20:04

Mike Cole


1 Answers

I don't think it's possible to customize the generated filenames in the current version.

Unless you want to try hacking the PowerTools source code, your best bet is probably just to refactor the class filename by pressing F2 after generation.

If you need to refactor a bunch of files, it may be worth it to write a small script that renames the classes, and their filenames, and run it after each EF generation.

like image 126
Gustav Bertram Avatar answered Nov 12 '22 08:11

Gustav Bertram