开发者

Change contents of SelectList

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜