LINQ is one of the greatest things that’s happened to Windows programming. I love it, and I use it all the time.
Occasionally, you’ll run into an enumerable collection class that can’t be queried with LINQ because it isn’t associated with a type. This can be easily overcome by using the Enumerable.Cast<T>() method.
Here’s a quick example from MSDN:
This is a great technique to use instead of settling and using a for-each loop (ick!).