blog @spotflux
These are the thoughts and opinions written by the spotflux team and our colleagues.
Show MenuHide Menu

Archives

Tech Tips: .NET Extension Methods

September 10, 2013   

Not unlike Scala, C# (but probably to a lesser extent) blends principles from both Java and Racket; giving you more than enough rope to hang yourself with, but at least providing some nice conveniences like closures, type inference and our topic for today: extension methods.

From Microsoft’s extension method documentation:
“Extension methods enable you to “add” methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written in C# and Visual Basic, there is no apparent difference between calling an extension method and the methods that are actually defined in a type.”

read more …