Following the recommendations for using extension methods, you can make a method an extension method from System.Object, from which all classes are derived. I would not defend this, but regarding your question this may be the answer.
namespace SomeNamespace { public static class Extensions { public static void MyMethod(this System.Object o) {
Now you can write code like MyMethod(); anywhere where using SomeNamespace; if you are not using a static method (then you will need to do Extensions.MyMethod(null) ).
StellarEleven
source share