你能帮我理解这个错误信息。我肯定做错了什么但是什么?
join子句中某个表达式的类型不正确。调用“加入”时类型推断失败。
Res.AddRange(from jh in db.Job
join jd in db.JobDetail on jh.number equals jd.number
join js in db.JobSection on new { jd.number, jd.ref, jd.product } equals new { js.number, js.ref, js.Product }
join oh in db.Order on jd.ref equals oh.ref
join bh in db.Buyer on jh.id equals bh.id
where jh.dateModify >= InputDate
select jh);
错误来自此行
join js in db.JobSection on new { jd.number, jd.ref, jd.product } equals new { js.number, js.ref, js.Product }
答案 0 :(得分:0)
在Evk的帮助下(见评论)我找到了解决方案
正确的解决方案是
Res.AddRange(from jh in db.Job
join jd in db.JobDetail on jh.number equals jd.number
join js in db.JobSection on new { a = jd.number, b = (int?)jd.ref, c = jd.product } equals new { a = js.number, b = js.ref, c = js.Product }
join oh in db.Order on jd.ref equals oh.ref
join bh in db.Buyer on jh.id equals bh.id
where jh.dateModify >= InputDate
select jh);