CSharp examples for System:Attribute
Get Attributes from Method
using System.Linq; using System.Reflection; using System.Collections.Generic; public class Main{ public static IEnumerable<T> GetAttributes<T>(this MemberInfo memberInfo, bool inherit = false) {// www. j ava 2 s. c om return memberInfo .GetCustomAttributes(typeof(T), inherit) .OfType<T>(); } }