A simple way of managing data seeding for Entity Framework 6 Apps
A simple way of adding data migrations to migrations within Entity Framework 6.
-
Add DataGrain.AddTableToModel(modelBuilder); to your OnmodelCreating method of your DbContext. This is so the __DataMigrations table can be configured and added to the context.
-
Add DataGrain.Seed(context, this); to your configuration seed method
-
Add as many data migration classes as you need (As long as they have the DataMigration attribute and inherit the IDataMigration interface, they will be found and used appropriatly.
- Complete Instructions
- Automate Testing