0
var result=from stdnt in students
           join lssn in lessons on new {number ==stdnt.state==true ? stdnt.newnumber : s.oldnumber}
equals new {number ==stdnt.state==true ? lssn.newnumber : lssn.oldnumber}
 select new {.... };

'lssn' 名称 'equals' 运算符不尊重右侧。表达式中的“等于”运算符考虑换边。

4

1 回答 1

0

尝试简化您的查询:

var reslt = from stdnt in students
            join lssn in lessons on (stdnt.state ? stdnt.newnumber : stdnt.oldnumber)
            equals (lssn.state ? lssn.newnumber : lssn.oldnumber)
            select new { ... };
于 2013-11-10T21:10:12.280 回答