Search for existing suggestions

Better syncing for 'update model from database'

If I have a database-first model, add a new db table then use "Update model from database" the wizard shows the new table and it is added to the model just fine

If I delete that table and update again, the table shows on the 'Delete' tab of the wizard but after clicking 'finish' the object still shows on the edmx diagram and the table's class file is still in my project. The only way to cleanup is to manually edit the edmx and delete the class files.

This is a problem for maintenance because for eg. I might not know what has changed in the database design so won't know what needs to be edited in my model. Perhaps add an option like 'make model match exact' when updating from database?

28 votes
Sign in
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Alwin shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Sign in with: facebook google
Signed in as (Sign out)
  • Steve Decker commented  ·   ·  Flag as inappropriate

    Ability to "Update Model from Database" and "Generate Database from Model" without Stored Procedures list disappearing in the Model Browser.

  • N2Cheval commented  ·   ·  Flag as inappropriate

    At least provide an option to update all if desired or provide a tool to show the differences.

    Right now one is running blind if another developer changes the database schema.

  • AdminMike Flasko (Lead Program Manager, Microsoft Entity Framework) commented  ·   ·  Flag as inappropriate

    As per, “Update Model from Database” updates only the data type lengths and nullability, however, it won’t always refresh the CSDL section.

    Due to this behavior, every time I update my database schema, I need to delete the .edmx file from my project and re-generate the ADO.NET entity model again from the database. BTW, this also requires a kludge to remove the previous ConnectionString from app.config, or else the names of the generated entities are not the same.

    I would like Update to work as if I had started from scratch, and not some optimized way I don't even understand. At least add an "Update Model from Database As If It Were From A New Database" option....

Feedback and Knowledge Base