开发者

Change contents of SelectList

开发者 https://www.devze.com 2023-02-04 01:28 出处:网络
Is there a way to remove items开发者_开发知识库 from a SelectList?No; it\'s immutable. Instead, you can build a copy with a Where call:

Is there a way to remove items开发者_开发知识库 from a SelectList?


No; it's immutable.

Instead, you can build a copy with a Where call:

var copy = new SelectList(original.Items.Cast<...>().Where(...));
0

精彩评论

暂无评论...
验证码 换一张
取 消