.NET languages ββthat do not support extension methods require users to call the method directly and pass in an object that would be extended. Therefore, it is important to document this parameter and accurately describe why it is needed, and how the method will act on it.
You can think about this a bit from the extension method, but if you present the method from the other side, where people call the static method, it is simpler.
One more thing ... Sometimes you may find yourself (for example, the HtmlHelper in MVC) where you distribute the object outside the convention, and not on the need. This means that it does not matter whether the object that is being distributed is null or not, because the method does not act on it. Although the convention (I suppose) is to throw when the this object is null, I prefer this method to execute normally and document this fact in the help system (ie "... it could be null" or "... null is a valid value for this argument.")
source share