[英]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. 我知道可以通过在文本编辑器中手动编辑EDMX文件来做到这一点。 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. 我宁愿在Visual Studio中以类似于在可能的情况下生成枚举的方式进行操作。
You can use the entity data model browser to update this. 您可以使用实体数据模型浏览器进行更新。 In your menu bar, navigate to View -> Other Windows -> Entity Data Model Browser
. 在菜单栏中,浏览至View -> Other Windows -> Entity Data Model Browser
。 I think you need to have your edmx file open to see this option. 我认为您需要打开edmx文件才能看到此选项。 That opens a model browser window and under the "Enum Types" folder you can double click your enum and update it. 这将打开一个模型浏览器窗口,在“枚举类型”文件夹下,您可以双击枚举并进行更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.