Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top