c#将枚举转换为集合

例:有如下枚举
public enum EnumGame
{
Aw = 11,
Bw= 21,
Cw=31,
Dw=41,
}

先定义一个实体类
public class EnumberGame
{
public int GameId { set; get; }
public string GameValue { set; get; }
}

在定义一个集合
List list = new List();
foreach (var e in Enum.GetValues(typeof(EnumGame)))
{
EnumberGame m = new EnumberGame();
object[] objArr = e.GetType().GetField(e.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), true);
m.GameId = Convert.ToInt32(e);
m.GameValue = e.ToString();
list.Add(m);
}

结果
c#将枚举转换为集合