I *think* this can be simplified to:
```C#
return
    methodInfo.GetCustomAttributes(typeof(T)).FirstOrDefault() as T ??
    methodInfo.Class.GetCustomAttributes(typeof(T)).FirstOrDefault() as T ??
    methodInfo.Class.Type.Assembly.GetCustomAttributes(typeof(T), true).FirstOrDefault() as T;
```