Building Your Own Toolbox with Extension Methods in C#
Too Long; Didn't Read
Extension methods are one of the coolest features of C#. They allow custom methods to be used on objects without needing to extend or change the underlying class. It's only a static method and it can only access the public interface of the object. It makes it look like the object has the method and allows us to write code in a declarative fashion. It expects an object of type, and if it is not, it calls the delegate function that's passed in. The C# toolbox is nothing but a collection of extension methods.