using System.Collections.Generic;
public static void Main()
var obj = new MyObject();
foreach(var m in GetExtMethod(obj.GetType()))
Console.WriteLine(m.Name);
public static IEnumerable<MethodInfo> GetExtMethod(Type classType)
var typeWhichCanBeExtClass = classType.Assembly.GetTypes()
.Where(t=>t.IsSealed && !t.IsGenericType && !t.IsNested);
var typeWithExtMethod = typeWhichCanBeExtClass.SelectMany(t=>t.GetMethods(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public))
.Where(m=>m.GetParameters()[0].ParameterType == classType && m.IsDefined(typeof( System.Runtime.CompilerServices.ExtensionAttribute), false));
return typeWithExtMethod;
public static class HelperClass
public static void YesExtMethod(this MyObject obj, String param)
public static void NoExtMethod(MyObject obj, String param)
public void MethodFromMyObject()