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