C# 遍历枚举

 

 

 

foreach (TaskTypeEnum tType in Enum.GetValues(typeof(TaskTypeEnum)))
{
        if (!list.Any(w => w.X == tType))
       {
                list.Add(new
          {
            X = tType,
              Y = 0
               });
        }
}

posted @ 2020-09-17 14:04  流年sugar  阅读(216)  评论(0编辑  收藏  举报