public class MyContext : DbContext
{
public MyContext() {
Database.SetInitializer(new DropCreateDatabaseIfModelChanges<MyContext>());
}
}
If we declare in global.asax then automatically will done. Database.SetInitializer(new DropCreateDatabaseIfModelChanges<MyContext>());
No comments:
Post a Comment