Entity Framework Automatic migration

c# entity-framework-6

Question

Whenever POCO updates occur, I only want to move the database to the most recent version of my 3-tier architectural project (Web, Service, DataAccess). Calling the automatic migration function from can help us accomplish this.Application_Start event. I don't have the reference for the in this situation,DataAccess venture in my web. Consequently, how can I invoke the automatic migration code fromApplication_Start event?

Database.SetInitializer(new MigrateDatabaseToLatestVersion<BlogContext, Configuration>()); 

I am unable to accessBlogContext from Application_Start .

Please assist me.

I appreciate you. Is there another way to update the database automatically in a production environment because we can't perform the update-database command through Visual Studio?

1
1
6/19/2015 6:08:39 AM

Accepted Answer

ZZZ_tmp
3
6/19/2015 5:59:22 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow