I have added a new column to a table in my database. The table is already defined in the existing Entity Framework model. I've been through most of the items here on how to do this and it still fails.
A little background, this entity model has not been updated in at least 3 years. So aside from the column I'm adding I know there have been a number of other columns that have been added in that time, but never included. I took over the project about 9 months ago and have never been able to successfully update the model.
First attempt:
- Opened the Model in Visual Studio
- Right Clicked on the Background
- Clicked on "Update Model From Database..."
- Clicked on the Refresh Tab
- Selected Tables
- Highlighted the specific table
- Clicked Finish
Result:
- Classes for Dozens of tables that were in my model were deleted
- The table in question was not updated
Second Attempt
- Restored all Source
- Same as above but
- After opening the Update Wizard, Clicked the Delete Tab
- Selected Tables
- Clicked Finish
- All the Tables were deleted
- Saved the EF Model/Closed/Opened it
- Went back to the Update Wizard Add Tab
- Clicked Tables
- None of my tables were displayed when I expanded everything
- Checked the checkbox at the Tables level
Result
- None of my tables were added back, but anything that was not originally included was added
Third Attempt
- Restored all source
- Deleted the two .tt files
- Opened the Update Wizard
- Clicked Add for Everything
Result
- Nothing was recreated, no .tt files or anything else.
Fourth Attempt
- Restored Source
- Deleted Table from the EF Model
- Opened Update Wizard
- Clicked Add Tables
Results
- Classes for Dozens of tables that were in my model were deleted
- The table in question was not added back
Final Attempt
- Added entity manually to model
Result
- Code all compiled and ran, but values were never retrieved from the DB or updated
Any help or direction that could be provided would be greatly appreciated as I'm at a critical point and have to get the model updated.