列舉 轉為 IEnumerable

public enum colors { red,blue,green }

var list=Enum.GetValues(typeof(colors)).Cast<colors>().Select(a => new { value = (int)a, text = a.ToString() });

留言

熱門文章