【发布时间】:2013-06-19 02:30:07
【问题描述】:
我尝试了很多东西,但对我来说最合乎逻辑的似乎是这个:
int divisor = AllMyControls.Take(p => p.IsActiveUserControlChecked).Count();
AllMyControls 是UserControls 的集合,我想知道有多少UserControls 将IsActiveUserControlChecked 属性设置为true。
我在 VS 中得到的是:
Cannot convert lambda expression to type 'int' because it is not a delegate type
我的表情有什么问题?
【问题讨论】: