2022年6月17日 星期五

列舉 轉為 IEnumerable

public enum colors { red,blue,green }

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

沒有留言:

自訂權限驗證機制

// 使用 filter [Route("api/[controller]")] [ApiController] [Authorize] [TypeFilter(typeof(CustomAsyncAuthorizationFilter))] public c...