title: IEnumerable<T> to a CSV file
body: <p>I am getting the result from LINQ query as var of type <code>IEnumerable&lt;T&gt;</code></p>
  
  <p>I want a CSV file to be created from  the result from the LINQ  </p>
  
  <p>I am getting the result from the following query</p>
  
  <pre><code>var r = from table in myDataTable.AsEnumerable()
          orderby table.Field&lt;string&gt;(para1)
          group table by new { Name = table[para1], Y = table[para2] }
          into ResultTable
          select new
          {
              Name = ResultTable.Key,
              Count = ResultTable.Count()
          };
  </code></pre>