title: How does one use .ToList() Inside of a Linq Query?
body: <p>I've got a class that contains a list item.  I would like for a linq query to populate the class, including this list.  Here is my query:</p>
  
  <pre><code>var query = from c in context.Cars
              select new CarListItem()
              {
                  ID = c.ID,                     
                  Make = c.Make,
                  AvailableColors = context.CarColors.Where(u =&gt; u.CarID == c.ID).ToList()
              };
  </code></pre>
  
  <p>Basically, I want to get a list of all of the cars, including a list of the available colors for each respective car.</p>
  
  <p>The problem is that the inclusion of .ToList() within the query results in an error: An error occurred:</p>
  
  <pre><code>LINQ to Entities does not recognize the method 'System.Collections.Generic.List`1[CarSystem.Models.CarColors] ToList[CarColors](System.Collections.Generic.IEnumerable`1[CarSystem.Models.CarColors])' method, and this method cannot be translated into a store expression.
  </code></pre>
  
  <p>At this point, I don't know whether I am just using wrong syntax within the Linq query (should I use something other than .ToList()?) or if maybe the architecture of the models is wrong.</p>