title: C# Linq query error " an expression tree may not contain a tuple literal"
body: <p>I have an SQL Server query as below,which I wanted to convert it to corresponding LINQ query</p>
  <pre><code>SELECT 
      j.ID,
      j.OnTime AS 'Alarm Appear Time',
      j.OffTime AS 'Alarm Disappear Time',
      j.OnNoticeTime AS 'Alarm Ack Time',
      j.OffNoticeTime AS 'Alarm Close Time',
      j.InstanceID AS 'Asset ID',
      i.RemarkPath AS 'Asset',
      j.PropertyID AS 'Message ID',
      p.Remark AS 'Alarm Message',
      a.X4AlarmGroup_ID AS 'Priority ID',
      g.Name AS 'Priority Group'
  FROM 
      [XAMRuntimeX4].[dbo].[X4Journals] j
  JOIN 
      [XAMRuntimeX4].[dbo].[V_X4InstanceRemarks] i ON j.InstanceID = i.Instance_ID
  JOIN 
      [XAMRuntimeX4].[dbo].[V_AutomationControlPropertyRemarks] p ON j.PropertyID = p.Property_ID
  JOIN 
      [XAMControlX4].[dbo].[X4AlarmConfigs] a ON j.InstanceID = a.X4Instance_ID
                                              AND j.PropertyID = a.X4Property_ID
  JOIN 
      [XAMControlX4].[dbo].[X4AlarmGroups] g ON a.X4AlarmGroup_ID = g.ID
  WHERE 
      i.Language = 'iv'
      AND p.LANGUAGE = 'iv'
  ORDER BY 
      j.OnTime DESC;
  </code></pre>
  <p>I managed to get a linq query, but it is showing error</p>
  <blockquote>
  <p>CS8143 an expression tree may not contain a tuple literal</p>
  </blockquote>
  <p>when I am trying to do the join of X4AlarmConfigs table using multiple column join</p>
  <pre><code>var finalAlarm = xAMRuntimeX4Context.X4Journals
     .Join(xAMControlX4Context.X4InstanceRemarks,
           j =&gt; j.InstanceID, i =&gt; i.Instance_ID, (j, i) =&gt; new { j, i })
     .Join(xAMControlX4Context.AutomationControlPropertyRemarks,
           ppc =&gt; ppc.j.PropertyID, p =&gt; p.Property_ID, (ppc, p) =&gt; new { ppc.j, ppc.i, p })
     .Join(xAMControlX4Context.X4AlarmConfigs,
           ppc2 =&gt; (ppc2.j.InstanceID, ppc2.j.PropertyID), a =&gt;   (a.X4Instance_ID, a.X4Property_ID),
                    (ppc2, a) =&gt; new { ppc2.j, ppc2.i, ppc2.p, a })
     .Join(xAMControlX4Context.X4AlarmGroups,
           ppc3 =&gt; ppc3.a.X4AlarmGroup_ID, g =&gt; g.ID, (ppc3, g) =&gt; new { ppc3.j, ppc3.i, ppc3.p, ppc3.a, g })
     .Where(ppc4 =&gt; ppc4.i.Language == &quot;iv&quot; &amp;&amp; ppc4.p.Language == &quot;iv&quot;)
     .OrderBy(ppc4 =&gt; ppc4.j.OnTime)
     .Select(x =&gt; new 
                  {
                      x.j.ID,
                      AlarmAppearTime = x.j.OnTime,
                      AlarmDisappearTime = x.j.OffTime,
                      AlarmAckTime = x.j.OnNoticeTime,
                      AlarmCloseTime = x.j.OffNoticeTime,
                      AssetID = x.j.InstanceID,
                      Asset = x.i.RemarkPath,
                      MessageID = x.j.PropertyID,
                      AlarmMessage = x.p.Remark,
                      PriorityID = x.a.X4AlarmGroup_ID,
                      PriorityGroup = x.g.Name
                  });
  </code></pre>