I'm getting an error when using a join in a LINQ statement:
'HalftimeHomeGoals is not a member of anonymous type; it does not exist in the current context'.
Dim HomeAllLP = (From a In db.Matches
Join b In db.MatchesLeagues On a.Id Equals b.Id
Where (a.HomeTeam = HomeTeam)
Order By a.Date Descending
Select a, b)
For Each y In HomeAllLP
If (y.HalfTimeHomeGoals > 0) Or (y.HalfTimeAwayGoals > 0) Then
HFHGL2 = HFHGL2 + 1
End If
Next
It works fine if I only select a, but if I try and select my joined table as well it gives the error, so I can't access my joined table.
I have looked this up but don't understand any of the answers I've found so far and they are all in C#, I'm using VB.NET.
y.a.HalfTimeHomeGoals?