Most of the seed data is used for develpment purposes only. All develompent data should not bring to production. The seed can be used to production if you really have data use on both development and production. If you don't have data to bring to production,
just remove the seed or all the initializer. Example commented the SetInitializer like the following code at Global.asax.cs:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
// Use LocalDB for Entity Framework by default
Database.DefaultConnectionFactory = new SqlConnectionFactory("Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True");
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
BundleTable.Bundles.RegisterTemplateBundles();
//Database.SetInitializer<SchoolContext>(new SchoolInitializer());
}
jsiahaan
Contributor
2552 Points
646 Posts
Re: EF 4.3 running Update-Database don't run seed data.
May 10, 2012 11:00 PM|LINK
Hi,
Most of the seed data is used for develpment purposes only. All develompent data should not bring to production. The seed can be used to production if you really have data use on both development and production. If you don't have data to bring to production, just remove the seed or all the initializer. Example commented the SetInitializer like the following code at Global.asax.cs:
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); // Use LocalDB for Entity Framework by default Database.DefaultConnectionFactory = new SqlConnectionFactory("Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True"); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); BundleTable.Bundles.RegisterTemplateBundles(); //Database.SetInitializer<SchoolContext>(new SchoolInitializer()); }Hope this can help.
Indonesian Humanitarian Foundation