public static IEnumerable <MethodInfo> GetAllMethods(this Type target) { List <Type> list = Enumerable.ToList <Type>(TypeExtensions.GetAllInterfaces(target)); list.Add(target); return(Enumerable.SelectMany <Type, MethodInfo, MethodInfo>((IEnumerable <Type>)list, (Func <Type, IEnumerable <MethodInfo> >)(type => (IEnumerable <MethodInfo>)type.GetMethods()), (Func <Type, MethodInfo, MethodInfo>)((type, method) => method))); }