Пример #1
0
 public static bool HasAttribute <TAttribute>(this IMemberInfo memberInfo)
 {
     return(memberInfo.GetAttributes().OfType <TAttribute>().Any());
 }
Пример #2
0
 public static TAttribute GetAttribute <TAttribute>(this IMemberInfo memberInfo)
 {
     return(memberInfo.GetAttributes().OfType <TAttribute>().FirstOrDefault());
 }