Advice on tuning seed data using nhibernate during development (rather than a test suite)

How should seed data be tuned when developing a nhibernate web application? (It Mvc)

Should I just create a method and run it when the application loads (when it will work in debug mode) and just comment on it when I do not need it?

or is there a better way?

+8
asp.net-mvc nhibernate
source share
1 answer

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.

0
source share

All Articles