Why is this thing giving the message in the second line (i.e. list convertion)?
IEnumerable<Order> MyQuery = from order in dataContext.GetTable<Order>()
where order.ID == 1
select new Order() {ID = order.ID, OrderDate=order.OrderDate };
List<Order> list = new List<Order>(MyQuery);
The message:
Explicit construction of entity type 'Order' in query is not allowed.
If it is already converted into an IEnumerable. The what is its problem to convert it into a List?
Again, if I write the following, it works:
IEnumerable<Order> MyQuery = from order in dataContext.GetTable<Order>()
where order.ID == 1
select order;
List<Order> list = new List<Order>(MyQuery);
Why? What is the trick?