CSharp examples for System:Attribute
Get Attribute from Method
using System.Linq; using System.Reflection; using System.Collections.Generic; public class Main{ public static T GetAttribute<T>(this MemberInfo memberInfo, bool inherit = false) {//from w ww . ja v a 2s .c o m return memberInfo .GetAttributes<T>(inherit) .SingleOrDefault(); } }