title: A type that implements IEnumerable 'System.Collections.Generic.List`1' cannot be initialized in a LINQ to Entities query
body: <p>I am trying to create object of some class inside the Linq query but gives me an error as set title of the question.</p>
  
  <p>My query is:</p>
  
  <pre><code>List&lt;oneViewModel&gt; workOrderInfoList = (from abc in db.ABC
    join customer in db.Customers on abc.CustomerId equals customer.CustomerId into customers
    select new oneViewModel()
    {
       CustomerId = abc.CustomerId,
       OrderNumber = workOrderInfo.OrderNumber,
       OrderDate = abc.OrderDate,
       SecondClassList = new List&lt;SecondClass&gt;(),
    }).ToList();
  </code></pre>
  
  <p>I have define the list of class in as object inside oneViewModel.</p>
  
  <pre><code>public class ABC        
  {
      public DateTime? WorkOrderDate { get; set; }
      public long CustomerId { get; set; }
  
      public string CustomerName { get; set; }
  
      public List&lt;SecondClass&gt; SecondClassList { get; set; }
  }
  </code></pre>