I have several Entity Framework entities that I deleted a few fields from.
(I thought that the consumers of the model would not need those fields. Turns out now that they do.)
I need to get those fields back in. I tried doing an “Update from Database” but that does not restore them. (I guess it is remembering that I wanted them deleted.)
I know I can just Delete then re-add the entity, but that causes other problems (I have several FK associations that needed to be renamed. I don’t want to do them again.)
How can I mark those fields for restoring?
Your EDMX store collection will still list the deleted fields. “Update from database” updates the store collection, and adds newly added tables and fields to the model. Since these fields aren’t newly added, they aren’t copied to the model. Basically what you said: EF remembers that you deleted them. But since they still exist in the store collection, you can manually add a property with the correct name and type, go to the Mapping Details window, and link it to the right database field.