News for hackers. Stuff that matters.
Re:Best Practices for Linq Enumerables and Queryables by redstripe on Friday August 24, 2012 @12:00PM (#4428163)
Assuming you have a foreign key set up between customers and orders, your 'order' entity will automatically have a 'customer' property so you can avoid the 'join' syntax.

If your objective is to find orders that belong to male customers over 30:

filteredCustomers = orders.Where(o => o.IsPending && o.customer.IsMale && o.customer.Age > 30);

Some more about avoiding joins (which makes it easier to use the extension syntax): http://blogs.teamb.com/craigstuntz/2010/01/13/38525/

There are no comments on this comment yet.