title: Entity Framework Select new POCO without .ToList() first
body: <p>I'm creating an application with a service layer (WCF Website) and a Silverlight 4 Client.  RIA Services are not an option, so we create intermediary classes to pass back and forth.  For the purpose of this question let's assume I'm passing back and forth Tasty <code>Food</code> Objects.</p>
  
  <pre><code>public class FoodData
  {
    public int Id { get; set; }
    public string Name { get; set; }
    public Tastyness TastyLevel { get; set; }
  }
  </code></pre>
  
  <p>The EF Model is essentially the same class, a table with three basic fields (the Tastyness is an int that corresponds to our enum Tastyness).</p>
  
  <p>I find myself using this kind of statement a lot when doing Entity Framework queries:</p>
  
  <pre><code>public List&lt;FoodData&gt; GetDeliciousFoods()
  {
    var deliciousFoods = entities.Foods
                                 .Where(f =&gt; f.Tastyness == (int)Tastyness.Delicious)
                                 .ToList()  // Necessary? And if so, best performance with List, Array, other?
                                 .Select(dFood =&gt; dFood.ToFoodData())
                                 .ToList();
  
    return deliciousFoods;
  }
  </code></pre>
  
  <p>Without the .ToList() call I get an exception about LINQ not being able to translate the custom method to a query equivalent, which I understand.</p>
  
  <p>My question is about the call to <strong>.ToList()</strong> before the <strong>.Select(...)</strong> with the custom extension to convert our object to the POCO version of the Food object.  </p>
  
  <p>Is there a better pattern to do here, or maybe even a better alternative to .ToList() that may be more performant since I don't really require the functionality of the List&lt;..> result.  </p>