我有一个LINQ查询,其中我需要专门做左连接。然而,当我尝试提交的查询其误差的拉姆达跳过功能,并说,跳过不能在LINQ查询与加入。

执行

这里的查询(跳过变量是一个参数到函数和clientDB是DataContext的):

            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
有帮助吗?

解决方案

我结束了只使用questionsQuery.ToList转换这对列表()。不是最好的解决方案,因为ToList函数返回整个结果设置为在内存中的列表,但它的工作。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top