title: How do I join on a constant in LINQ?
body: <p>I'm trying to do a left join on a constant like this:</p>
  
  <pre><code>SELECT 
      [t0].[DeviceId], 
      [t0].[DeviceTypeId], 
      [t0].[UnitId], 
      [t0].[UnitNum], 
      [t0].[ManPhone], 
      [t0].[Status], 
      [t2].[MaintDate] AS [ServiceExpiration]
  FROM [dbo].[Devices] AS [t0]
      INNER JOIN [dbo].[CustomerDevices] AS [t1] 
          ON ([t0].[DeviceId]) = [t1].[DeviceId]
      LEFT JOIN [dbo].[Maintenance] AS [t2] 
          ON ([t0].[DeviceId]) = [t2].[DeviceId]
              AND 8 = [t2].ActionId
  </code></pre>
  
  <p>I get a <a href="http://msdn.microsoft.com/en-us/library/bb513747.aspx" rel="nofollow noreferrer">CS1941</a> when I attempt it in LINQ like this:</p>
  
  <pre><code>var devices = from d in db.Devices
      join cd in db.CustomerDevices
          on d.DeviceId equals cd.DeviceId
      join serviceExpiration in db.Maintenances
          on 
             new { d.DeviceId, ActionId = 8 } // CS1941
                 equals 
             new { serviceExpiration.DeviceId, ActionId = serviceExpiration.ActionId } into j1
      from deviceServiceExpiration in j1.DefaultIfEmpty()
  </code></pre>