Client_Payroll_Items.AsEnumerable().Select((row, index) => new {row, index})
.Where(
(x => x.row.Client_KEY == 3) &&
(x => x.row.Description == "401(k) % of Gross")
)
//.Where(x => x.row.Description == "401(k) % of Gross")
.Select(x=> x.row.Payroll_item_calculation_type_KEY)
.DefaultIfEmpty(-1)
.First();
実行すると、「演算子'&&'はタイプ'ラムダ式'および'ラムダ式'のオペランドに適用できません」というエラーが発生します。
Client_Payroll_Items
.AsEnumerable()
.Select((row, index) => new {row, index})
.Where(x => x.row.Client_KEY == 3)
.Where(x => x.row.Description == "401(k) % of Gross")
.Select(x=> x.row.Payroll_item_calculation_type_KEY)
.DefaultIfEmpty(-1)
.First()
最新のものが実行され、必要なものが得られます。
質問-なぜ最初のコードにエラーがあるのですか?