代码片段 · 2023年3月4日

C# 中如何使用EnumHelper 将枚举值转换为Description描述文字string,或从string转换为枚举值

废话不多说,看代码

1、先定义枚举类型

2、添加EnumHelper类

 

3、另一个版本的EnumHelper