Coffeehouse Post

Single Post Permalink

View Thread: C# biggest awesome
  • User profile image

    I am getting a lot of mileage out of extension methods. It was a great day when I found out you could code extension methods for interfaces and enums as well as classes. Simply as a way to organize code, where I place methods that apply to an interface or enum in a static class in the same file as the interface/enum.  Something else useful about extension methods is  the this object can be null and the extension method will still be called. Which is not the case with a method of a class.