我与Linq-To-Sql有一个问题
在“加入”
的调用中,类型推断失败var conditionsFound = (from QuantiReports.Data.RoomInspectionGuid test in tests
where test.roomfloorid == obj.floorroomId
join testItem in testItems //This join statement has an error
on new { roomItemId = obj.roomitemId, testId = test.id } equals new { roomItemId = testItem.roomitemid.Value, testId = testItem.roominspectionid }
join testsCondition in testsConditions
on new { conditionId = condition.id, testitemId = testItem.id } equals new { conditionId = testsCondition.conditionId, testitemId = testsCondition.roomItemInspectionId }
select testsCondition).Count();
答案 0 :(得分:1)
除语法外,您可以在新{conditionId = condition.id "上查看第二个连接表达式" 。检查类型" 条件"是否定义。