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)
...