title: Entity Framework: How to perform left join with EF and LINQ among multiple tables
body: <p>basically i have 3 tables and those are <code>user,colors and usercolor</code></p>
  
  <h2>tables info</h2>
  
  <pre><code>User Tables has fields like -&gt; UserID, UserName
  
  Color Tables has fields like -&gt; ColorID, ColorName
  
  UserColor Tables has fields like -&gt; UserID, ColorID
  </code></pre>
  
  <p>i have corresponding <code>dbset classes</code> in my code.</p>
  
  <p>now see the below query where left join is performed among 3 tables in sql and tell me how to write the same equivalent query with EF and LINQ.</p>
  
  <pre><code>select c.ColorID
      , c.ColorName
      , IsSelected = case when uc.ColorID is null then 0 else 1 end
  from dbo.Colors c
  left join dbo.UserColor uc on uc.ColorID = c.ColorID and uc.UserID = 1 --leave this in the join or it becomes an inner join
  left join dbo.Users u on u.UserID = uc.UserID
  </code></pre>