title: How to use constant value in Linq left join?
body: <p>I need to use constant value in left join as below sql in Linq expression. How to achieve that in linq expression.</p>
  
  <pre><code> SELECT *
      FROM [dbo].[s1AlertLog] AS [Extent1]            
    LEFT OUTER JOIN [dbo].[smManualChapter] AS [Extent4] ON [Extent1].[mwEventDetailKey] = [Extent4].[ID] and [Extent1].mwEventTypeKey = 300  Where Extent1.mwcUsersKey = 8000           
  </code></pre>
  
  <p>Linq</p>
  
  <pre><code>    var list = (from alert in ctx.Set&lt;S1AlertLog&gt;()
                        join smManualChapter in ctx.Set&lt;SmManualChapter&gt;() on new { alert.MwEventDetailKey, alert.MwEventTypeKey } equals new { smManualChapter.ID, 300}
                            into temp1 
                        from tempChapter in temp1.DefaultIfEmpty()
                        select  alert
              );
  
    var result = list.Where(x=&gt;x.mwcUsersKey == 8000);
  </code></pre>