Imran Ali
Imran Ali

Reputation: 97

The type of one of the expression in the join clause is incorrect. Type inference failed in the call to 'Join'

I have a promblem with Linq-To-Sql

Type inference failed in the call to 'Join'

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();

Upvotes: 0

Views: 2018

Answers (1)

Rohit Khajuria
Rohit Khajuria

Reputation: 54

Apart from syntax , can you check in second join expression "on new { conditionId = condition.id". Check if type "condition" is defined or not.

Upvotes: 1

Related Questions