I have a localdb that is working just fine on my development machine, however when I tried to test the app on another machine, I found that somehow changes do not take effect on the dB. What could make entity framework behave differently on my machine than in the other one?
Here is my DbContext
public DataContext() : base("name=DBConnectionString")
{
Database.SetInitializer(new DataInitializer());
}
And the DataInitializer class:
public class DataInitializer: DropCreateDatabaseIfModelChanges<DataContext>
{
public DataInitializer()
{
}
protected override void Seed(DataContext context)
{
//Insert some seed data
Console.WriteLine("Seeding db...");
...
base.Seed(context);
}
}
and the connection string:
<connectionStrings>
<add name="DeltaDBConnectionString"
connectionString="Server=(localdb)\v11.0;Integrated Security=true;
AttachDbFileName=|DataDirectory|\DeltaDB.mdf;"
providerName="System.Data.SqlClient"/>
</connectionStrings>