本文翻译自:How do I convert an enum to a list in C#? [duplicate]
This question already has an answer here: 这个问题在这里已有答案:
- How do I enumerate an enum in C#? 如何在C#中枚举枚举? 26 answers 26个答案
Is there a way to convert an enum
to a list that contains all the enum's options? 有没有办法将enum
转换为包含所有枚举选项的列表?
#1楼
参考: