You add new table to database.
You want to quickly create appropriate POCO class uses solely for ORM (NPOCO) or any of your own.
How?
http://stackoverflow.com/questions/10136520/how-to-automatically-create-model-from-database-using-petapoco-library
Create console app.
Add app.config
Add connection string
Install NuGet package "Peta Poco" (Topten Software, ver 5.0.1 but any will do).
I'm not sure do you need to rebuild.
Peta poco should generate Models / Generated / Database.tt
Right click Database.tt and "Run custom toll":
Voila !
Under Database.tt you will find Database.cs. There you'll find all your Poco classes.
Watch it !
Carefully check what is generated. This template from Peta Poco is not perfected but it should do job for most common scenarios.
No comments:
Post a Comment