entity framework - EF Code First When Changes Are Needed To Models, Any Way To Not Have To Drop DB? -


i'm trying grip on code first , far every time make change model need drop , recreate database. data that's in database? find annoying have every time , doesn't make a web approach unless 100% sure you'll never have make change such adding new column in table. there way prevent happening?

by default database initializer set dropcreatedatabaseifmodelchnages. can set database initializer null avoid recreating,

database.setinitializer<yourcontext>(null); 

the other option use database migrations update database without recreating it.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -