public static IEnumerable <T> AllAttributes <T>( this MemberInfo provider) where T : Attribute { return(provider.AllAttributes(typeof(T)).Cast <T>()); }
public static bool HasAttribute <T>(this MemberInfo provider) where T : Attribute { return(provider.AllAttributes(typeof(T)).Any()); }
public static T TryGetAttribute <T>(this MemberInfo provider) where T : Attribute { return(provider.AllAttributes <T>().OnlyOrDefault()); }
public static bool HasAttribute( this MemberInfo provider, params Type[] attributeTypes) { return(provider.AllAttributes(attributeTypes).Any()); }
public static T GetAttribute <T>(this MemberInfo provider) where T : Attribute { return(provider.AllAttributes <T>().Single()); }