C# 遍历Enum( 枚举)

Type enumType = typeof(Domain.Models.Entitys.PermissionEntity.PermissionTypeEnum);
                    Array values = Enum.GetValues(enumType);
                    if (values.Length > 0)
                    {
                        foreach (int item in values)
                        {
                            <option value="@item.ToString()">@Enum.GetName(enumType, item)</option>
                        }
                    }

posted @ 2021-05-12 10:07  LuoCore  阅读(433)  评论(0编辑  收藏  举报