I\'ve been searching the difference between Select
and SelectMany
but I haven\'t been able to find a suitable answer. I need to learn the differenc
Some SelectMany may not be necessary. Below 2 queries give the same result.
Customers.Where(c=>c.Name=="Tom").SelectMany(c=>c.Orders)
Orders.Where(o=>o.Customer.Name=="Tom")
For 1-to-Many relationship,
from o in Orders
join c in Customers on o.CustomerID equals c.ID
where c.Name == "Tom"
select o