SmoothFriction.nl

posts - 39, comments - 20, trackbacks - 0

January 2010 Entries

TekPub's Mastering LINQ Challenge

I’m always up for a challenge. I still have to watch the Mastering LINQ videos up on TekPub (which is amazing by the way, I encourage you to check it out!), but someone (hi Tuna!) tweeted about a small challenge related to the series. Basically, the challenge is to use a chained LINQ statement to create a prime number filter, without using any custom functions. Without further delay, here’s my solution: var primes = Enumerable.Range(1, 30) .Where(x => x > 1) .Where(x => x%2 != 0 && x != 2) ...

posted @ Saturday, January 09, 2010 12:07 AM | Feedback (3) | Filed Under [ c# LINQ ]