Basically, I have a Sql Server database whose schema is changing. When this happens, I have to update the EF data model. This is normal if all I did was add or remove a table: go to the designer, find "Update model from database ..." from one of several places where it exists, and go through the wizard.
Unfortunately, the wizard does not just allow me to replace the entire model from the database. He can also do only one at a time. Therefore, if I make an unsuccessful decision to make several changes to the scheme and even worse, forget about what I did: I need to take several steps to add, update and delete tables from the model.
This is obviously cumbersome. Therefore, due to the lack of a better procedure, I have to blow off the model and go through all the steps to recreate it from the database. Crap: I left the connection string in the configuration file. Now I need to delete this and run the wizard, otherwise it will not generate the same entity class name, and now all my code will break.
Why can't it just blow away the model for me and produce from the database? More importantly, why has no one else asked this question? What are people doing?
c # sql-server entity-framework
Sam rueby
source share