Still getting used to LINQ syntax, and have come across this query that I need to create in LINQ – but not exactly sure how.
SELECT *,
(SELECT 1 FROM Applications
WHERE Applications.jID = Jobs.ID
AND Applications.uID = @uID) AS Applied
FROM [Jobs]
Playing in LinqPad, but the interface isn’t really helping (at least with what I can see).
Based on the link provided by Paul Sasik, and his advice that you’re after a
LEFT OUTER JOIN, this query should meet your requirements;EDIT:
To filter by user, update the query as follows;
I personally would have reverted to just using the .Where() method directly at this point, but just thought I’d keep everything consistent and continue using the query syntax.