I suggest looking at something like AutoPoco .
AutoPoco replaces manually created parent objects / test data collectors with a smooth interface and an easy way to generate large amounts of read data. By default, manual tuning is not required, agreements can be written regarding the names / types of property, or manual tuning can be used against specific objects.
The main use cases are
- Creating uniform, valid objects for unit tests in a standard way in all tests
- Creating a large amount of valid test data for the database
This is not directly related to NHibernate - theoretically, you can combine it with any data layer that can be stored in POCO.
I would not add code to Application_Start, although it sounds like a recipe for accidentally destroying your production database. You would be better off creating a simple console application that you can run when you want to reload your database.
richeym
source share