How do I use Entity Framework in Code First Drop-Create mode?

code-first entity-framework

Question

Entity Framework v4 is what I use. I have adhered to the Nerd Dinner instruction's directions. Since the models are still quite volatile and I don't care to keep data, I would like for tables to be recreated on each new deployment while I'm still in development mode (not released to any higher environments). This does not, however, happen. Nothing is changing in the database or creating/modifying new tables. I can use my migrations if I switch to a migrations model by using the Package Manager commands enable-migrations and add-migration (initial). The only problem is that I have to manually destroy the database, the migrations folder, and the instructions (enable-migrations, add-migration) every time I make a change because I don't currently want granular migrations and simply want my initial creation script.

How can I make code first behave in the drop/create manner?

1
34
3/1/2013 4:52:24 PM

Accepted Answer

ZZZ_tmp
53
3/1/2013 5:00:44 PM

Popular Answer

ZZZ_tmp


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