私は多くのことを試しましたが、私にとって最も論理的なものはこれのようです:
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
私の表現の何が問題になっていますか?