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();
当我运行它时,我收到“运算符'&&'不能应用于'lambda表达式'和'lambda表达式'类型的操作数”错误。
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()
最新的运行,我得到了我需要的。
问题 - 为什么第一个代码中的错误?