0

我无法得到正确的结果,也许它在第一次查询时就坏了,有人能找到问题所在。

var query = from case in dbEntity.Cases
    join Comm in dbEntity.Comms on case.log_id equals comm.CaseId into collection
    from subCase in collection.DefaultIfEmpty()
    select new { case, subCase.status };

我想获取所有案例和状态值Commslog_id并且CaseId是连接键。

4

1 回答 1

0
var query = from case in dbEntity.Cases
join Comm in dbEntity.Comms on case.log_id equals comm.CaseId into collection
from subCase in collection.DefaultIfEmpty()
select new { Case=case,Status= (subCase==null?null:subcase.Status };
于 2012-07-27T06:42:53.753 回答