我有一个 linq 查询,我需要在其中专门进行左连接。但是,当我尝试在查询上提交 lambda Skip 函数时,它会出错并说无法在带有连接的 linq 查询上执行跳过。
这是查询(skip 变量是函数的参数,clientDB 是数据上下文):
Dim questionsQuery = From helpQuestion As HelpQuestion In clientDB.HelpQuestions _
Group Join helpCat As HelpCategory In clientDB.HelpCategories _
On helpCat.ROW_ID Equals helpQuestion.CATEGORY_ID Into helpGroup = Group _
From helpCategory In helpGroup.DefaultIfEmpty() _
Where helpQuestion.DISPLAY_DESK _
Order By helpQuestion.ROW_ID Descending _
Select helpQuestion.ROW_ID, helpQuestion.EMAIL, helpQuestion.FIRST_NAME, helpQuestion.LAST_NAME, helpQuestion.QUESTION, helpQuestion.CREATED, helpQuestion.RESPONSE, helpCategory.CATEGORY_NAME
If skip > 0 Then
questionsQuery = questionsQuery.Skip(skip)
End If