This simple Linq query:
from c in mycontext.Customers
join o in mycontext.Orders on c.CustomerId equals o.CustomerId
where o.Status == 1
select new {c, o}
will result in
List<{c:Customer, o:Order}>
after calling ToList()
.
What's the easiest way of converting this anonymously typed list into a list of customers (List<Customer>
)?
EDIT: I need the orders for an extra condition, I've changed my original question.