public static MethodInfo GetPublicInstanceMethod(this Type type, string name) { return type.GetRuntimeMethods() .FirstOrDefault(m => m.IsPublic && !m.IsStatic && m.Name.Equals(name)); }