According to Microsoft, “Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type”.
Is there a way to add an extension method that it called as if it was a static method? Or to do something else that has the same effect?
Edit:
By which I mean “called as if it was a static method on the extended class”.
Sorry for the ambiguity.
Yes, extension methods are static methods. They can all be called in the normal way as static methods, as extension instance methods on the type they “extend”, and they can even be called as extension methods on a null reference.
For example:
Edit:
Do you mean you want to call, for example, string.MyExtensionMethod()? In this case, no, there is no way to do that.