I am using entity Database First Entity framework. I have generated my EDMX file in visual studio, as well as the objects (in Model.tt)
I have 1 table (in this example)
Users:
Username varchar
Password varchar
Email varchar
I then added a new column "LastLoggedIn" in my database via SQL manager. So my table now looks like:
Users:
Username varchar
Password varchar
Email varchar
LastLoggedIn DateTime
I then clicked on Model.edmx file and ran the Update Model from Database. The Table was updated in the EDMX diagram, however the code (in the model.tt - users.cs) file did not update.
How do I force the objects to update after the EDMX diagram has been updated?
EF can be a bit of a pain at times, and doesn't like to update. For tables, when this happens, delete the table from the diagram. Then save it. Then do a right click and choose to Update the edmx. This should add the updated table with the new column.