简体   繁体   中英

Can I trigger a re-seed without a model change?

My database initializer extends DropCreateDatabaseIfModelChanges . This is generally how I want my app setup. However, occasionally I muck things up bad enough that I would like to go ahead and trigger drop and reseed, even though my model has not changed. Is this possible?

Extend from DropCreateDatabaseAlways

It will always drop, re-create and seed the database.

An implementation of IDatabaseInitializer that will always recreate and optionally re-seed the database the first time that a context is used in the app domain. To seed the database, create a derived class and override the Seed method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM