title: Subquery in select Linq
body: <p>My query is as below</p>
  
  <pre><code>var result = from cr in cumulativeresult
      orderby cr.Days
      select new
      {
          Days = cr.Days,
          Com = (from cr1 in cumulativeresult
              where cr1.Days &lt; cr.Days
              group cr1 by 1 into cr1grp
              select
              new
              {
                  Count = cr1grp.Count() + cr.Com 
              }),
          ComPercent = Math.Round((double.Parse((
              from cr1 in cumulativeresult
              where cr1.Days &lt; cr.Days
              group cr1 by 1 into cr1grp 
              select cr1grp.Count() + cr.Com).ToString()) / ComCount) * 100, 2)
      };
  </code></pre>
  
  <p>But the Com and ComPercent are not coming as values. How will I be able to retrieve the value within them? My loop for retrieving them is as follows</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code>foreach (var item in result)
  {
      dt.Rows.Add(item.Days, item.Com, item.ComPercent);
  }
  </code></pre>
  
  <p>I do not want to do any processing on my foreach loop, I want the value in my linq query itself.</p>