I have the following SQL statement
SELECT
c.CorpSystemID, c.SystemName ,
case when a.TaskItemID is NULL then 'false' else 'true' end as Assigned
FROM CorpSystems c
LEFT OUTER JOIN
(SELECT CorpSystemID, TASKItemID
FROM AffectedSystems
where TASKItemID = 1) a ON c.CorpSystemID = a.CorpSystemID
Can anyone please help me to convert this statement to LINQ?
Thank you.
Ok so assume you’ve got a list of your
CorpSystemobjects in a variable calledCorpsystemsand a list of yourAffectedSystemobjects in a variable calledAffectedSystems. Try the following:Edit: For a join on all Affected Systems, try this:
Or for just AffectedSystems that have a TaskItemId of 1: