An example of extension method & generic method in c#

Posted on Thu 14 August 2014 in misc

Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.

A generic method is a method that is declared with type parameters

This example include Extension method & generic method: