Wednesday, September 13, 2017

Manually update an Entity Framework .edmx file.

This approach can be overkill. If you are just adding a column to a table, open the GUID editor for the .edmx in Visual Studio 2015 and add the new column there. The properties pane in Visual Studio 2015 will let you define if the column is null and how many characters it may be, etc. Then open the .edmx in Notepad and splice in the change in three places:

  1. the EntitySetMapping with your table name
  2. the EntityType under Schema under edmx:StorageModels at the beginning of the file with your table name
  3. the EntityType under Schema under edmx:ConceptualModels farther down the file with your table name

 
 

One of these three changes happens as a side effect of your GUI change, but I cannot remember which. It should be pretty easy to figure out how to add a column in all three places. You just copy from the existing columns and do doctor ups.

No comments:

Post a Comment