Search code examples
c#entity-frameworkef-database-first

How to modify an enumeration created with DB-first Entity Framework


I followed the directions as detailed in this answer, and my enumeration was saved and can be utilized throughout the app. But in the case that I wanted to add additional options or change the names of existing options, how do I that?

I know I can do so by editing the EDMX file by hand in a text editor. I'd rather do it within Visual Studio in a fashion similar to how I generated the enumeration to begin with if it's possible.


Solution

  • You can use the entity data model browser to update this. In your menu bar, navigate to View -> Other Windows -> Entity Data Model Browser. I think you need to have your edmx file open to see this option. That opens a model browser window and under the "Enum Types" folder you can double click your enum and update it.