What Are Extension Methods Extension Methods are a new feature in C# 3 and VB 9. To put it concisely, an extension method is a static helper function that can be invoked as if it were declared on any object that has a type matching that of its first parameter. It's pure syntactic sugar. Extension methods basically allow you to change this: List<String> injuredSecondary = new List<String>
{ "Mike Brown" , "Nathan Vasher" , "Charles Tillman" }; //Note that select is a static method on the System.Linq.Enumerable class IEnumerable<String> namesake = Enumerable.Select(injuredSecondary, x => x == "Mike Brown" ); To this: List<String> injuredSecondary = new List<String>
{ "Mike Brown" , "Nathan Vasher" , "Charles Tillman" }; //Note that we are calling select as if it were a method defined on the injuredSecondary object. IEnumerable<String> namesake = injuredSecondary.Select(x => x ==
Read More...