In Visual Studio 2010 EF 4, I could add a new column to a database table, then click ‘Update Model from Database’ on my .edmx and all was good in the world.
In Visual Studio 2012 EF 5, I alter a table, and then click ‘Update Model from Database’ and it does not pick up the changes to individual tables anymore.
Am I missing something … or is this a new ‘feature’ of VS2012?
Update
The only way I can get a table with an added column to reflect in the .EDMX file is to delete the table then ‘Update Model from Database’ and it will pick up the added column. However, it puts the added table far off to the left and I have to move it back in place. No biggie just an annoyance.
There is a difference between having an EF Model and how it is underlined in your database. When you “Update model from database”, if the entity/table is already imported into your data model then you will be refreshing the entity. This process will not automatically map your database schema to your existing data model, you can however add a property to the entity in your EF model, and then map the property to the database column (this is exactly what EF does for you automatically when you delete and update normally).
When you delete the entity first, then update EF knows that the table/entity has not been imported before and so will map all of the database columns automatically for you.
In summary, you don’t HAVE to delete the entity, but it can be easier to do so for simple entities.