title: getting individual fields from a linq query which is run from a function
body: <p>I have a function that return a linq result :</p>
  
  <pre><code>  private IEnumerable&lt;object&gt; prepareData()
      {
          var data = from res in Globals.ds.Tables[0].AsEnumerable()
                       .GroupBy(x =&gt; new
                       {
                           art = x.Field&lt;string&gt;("artiste"),
                           alb = x.Field&lt;string&gt;("album"),
                       })
                        .Select(p =&gt; new
                        {
                            album = p.Key.alb,
                            artiste = p.Key.art,
                            count_lab = p.Count(),
                            lab = p.Select(x =&gt; x.Field&lt;string&gt;("label")).First(),
                            filp = p.Select(x =&gt; x.Field&lt;string&gt;("file_path")).First()
                        })
                       .OrderBy(x =&gt; x.lab)
                     select res;
          return data;
      }
  </code></pre>
  
  <p>The query works well as designed, i can do <code>data = PrepareData();</code> and get the right results.</p>
  
  <p>My issue is when i want to do a <code>.where</code> on the <code>data</code>.</p>
  
  <p>if i do :</p>
  
  <pre><code>var album = data.Where(x =&gt; x.
  </code></pre>
  
  <p>Then i dont have any option to select a single field (it's the same if i want to do a <code>.Select()</code>).
  I tried <code>data.AsEnumerable()</code> before but to no success.</p>
  
  <p>I'm thinking the <code>IEnumerable&lt;object&gt; prepareData()</code> is the culprit, but i have no idea how to fix this (if ever it's the case).</p>
  
  <p>I need help</p>
  
  <p>Thanks in advance</p>