tags:

views:

213

answers:

1

I have a linq query in which I need to specifically do a left join. However when I attempt to commit a lambda Skip function on the query it errors and says that the skip cannot be performed on a linq query with a join.

Here's the query (the skip variable is a parameter into the function and clientDB is the 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
A: 

I ended up just converting this to a list using questionsQuery.ToList(). Not the best solution because the ToList function returns the entire result set to an in-memory list, but it worked.

Adam