Question

In my ASP.NET 4.0 WSP project, I'm using PetaPoco for most of the data access. I've successfully generated the classes from the Database using the T4 templates. But, by default, when you set install PetaPoco, the Database.tt file is in /Models/Generated. So, the resulting database.cs file is placed there. But, since I'm not compiling the project (since it's WSP), I can't use the database classes. I know I could manually move the generated database.cs file into App_Code to use it or move the database.tt file into App_Code and that would cause it to generate the database.cs in App_Code but I wanted to make sure to use the best approach and I'm not finding relevent content on the interwebs.

So, how should I handle this?

Was it helpful?

Solution

Moving the Database.tt to the App_Code folder is the right thing to do. There no much more magic than that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top