Extension Methods extend existing .NET types with new methods. Extension methods make it possible to extend existing types and constructed types with additional methods, outside their definitions.
Extension methods allow developers to add new methods to an existing type without having to create an inherited class or to recompile the original.
An Extension Method has two stipulations:
This code sample extends the String base class by adding a SpaceToUnderscore() method.
Insert the keyword "this" before the first method parameter, which indicates to the compiler the type you want to extend. The method and its class must be static.