public static T GetCustomClassAttribute <T>(this ActionDescriptor actionDescriptor) where T : Attribute { return(actionDescriptor.GetCustomClassAttributes <T>().FirstOrDefault()); }