Not Queryable ?

Dim myDatesToCompare As New List(Of DateIndexMatching)

...

Dim finalMatches = From combo In (From _set In myDatesToCompare.OrderBy(Function(x) x.OfDate) Select _set).FirstOrDefault() _
                               Select combo


When I add FirstOrDefault to my LINQ I receive error   Expression of Type ......DateIndexMatching is not Queryable Make sure you are not missing assembly..blabla

Acutally its working great if I remove the firstOrDefault()  I am jsut trying to retrive only the first row of this query...

any idea?
LVL 1
PhilippeRenaudAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
I had removed Select combo.
0
 
CodeCruiserCommented:
May be you want this

Dim finalMatches = (From combo In (From _set In myDatesToCompare.OrderBy(Function(x) x.OfDate) Select _set)).FirstOrDefault()
0
 
PhilippeRenaudAuthor Commented:
with that i have error on the line   Select Combo


saying  end of statement expectped
0
 
PhilippeRenaudAuthor Commented:
Perfect
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.