Seed your data

Entity Framework provides great tools for updating your database's schema, with auto-generated codefiles based on your classes, but when it comes to putting actual data into your fresh database, it provides you with only the bare minimum;

Separate your seed data

I find there are generally two types of data I'm seeding into a fresh database. the data I want present in every instance of your database; for example tables containing a semi-static set of information, say to power dropdown boxes - lookup data. The other is test data that will only exist on developer instances or perhaps in a testing environment.

I've built a pretty easy-to-use library to assist with this common task. It's modeled loosely off of the Schema migrations provided by EntityFramework. What DataSeed does is help you to structure and order your 'seeds', and also transactionalizes the process so if any seed fails, no changes will be made to your database.

Now the next time you run 'update-database' your database will be filled with all the lookup data you need. And the next time another developer pulls down the code and inits their database they, too, will get all this lovely test & lookup data without having to restore any bak files or run any SQL scripts manually.

You can follow the setup guide, and follow the progress of the project here.