I have a DatabaseInitializer
class
public class DatabaseInitializer : CreateDatabaseIfNotExists
{
protected override
to get Seed
method to be called when you are not using AutomaticMigration
, you should use MigrateDatabaseToLatestVersion
initializer for your code-first database.
like this:
Database.SetInitializer(new MigrateDatabaseToLatestVersion<YourContext,YourConfiguration>());
this way, Seed
method will be called every time the migration is done successfully.