public static void Main()
Type t = typeof (MyAnnotatedClass);
foreach (var prop in t.GetProperties())
MyAnnotationAttribute attr = prop.GetCustomAttribute<MyAnnotationAttribute>(true);
Console.WriteLine(attr.Message);
public class MyAnnotatedClass
[MyAnnotationAttribute("This is value ONE!")]
[MyAnnotationAttribute("This is value TWO!")]
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class MyAnnotationAttribute : Attribute
public MyAnnotationAttribute(string msg)