public static bool IsAttributeDefined <T>(this ICustomAttributeDescriptor attributeResolver, ICustomAttributeProvider attributeProvider, bool inherit = true) where T : Attribute
 {
     return(attributeResolver.IsDefined(attributeProvider, typeof(T), inherit));
 }
 public static T GetCustomAttribute <T>(this ICustomAttributeDescriptor attributeResolver, ICustomAttributeProvider attributeProvider, bool inherit = true)
     where T : Attribute
 {
     return(GetCustomAttributes <T>(attributeResolver, attributeProvider, inherit).SingleOrDefault());
 }
 public static IEnumerable <T> GetCustomAttributes <T>(this ICustomAttributeDescriptor attributeResolver, ICustomAttributeProvider attributeProvider, bool inherit = true)
     where T : Attribute
 {
     return(attributeResolver.GetCustomAttributes(attributeProvider, typeof(T), inherit).Cast <T>());
 }