I saw several other posts asking a similar question, but frankly, I'm confused. I am trying to execute the following sql statement in EntityFarmework and Linq, but cannot make "NOT IN" and "UNION" work
SELECT LmsTeam.* FROM LmsTeam
INNER JOIN Game ON LmsTeam.GameId = Game.ID
WHERE LmsTeam.Id NOT IN
(SELECT TeamHomeId as TeamID FROM LmsEventMatch WHERE EventId =1
UNION
SELECT TeamAwayId as TeamID FROM LmsEventMatch WHERE EventId =1)
AND LmsTeam.GameId = 1 AND LmsTeam.Active = 1
So, I have joinsome where clauses, as shown below, but they cannot execute NOT INand clauses UNION.
from t in LmsTeams
join g in Games on t.GameId equals g.Id
where t.GameId == 1 && t.Active == true
select t
source
share