LINQ: Where are my extension methods?

The powerful Extension Methods due to LINQ have made our development really simple and easy. However in some cases these methods are not available as depicted in the following screenshot.

Here are a few scenarios in which we may find our extension methods missing:

  • Iterating through all the controls in a Windows Form (or any other container control) via their Controls collection
  • Iterating through items in our classic non-generic collections (e.g. ArrayList) under System.Collections namespace
  • Iterating through Columns in a DataGridView control
  • Iterating through Matches while working with Regular expressions
  • Retrieving enumeration values via Enum.GetValues

Read the rest of this entry »

Advertisements