[System.AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class GrandpaAttribute : Attribute
public GrandpaAttribute()
public string First {get;set;}
public class ParentAttribute : GrandpaAttribute
public string Name { get; private set; }
public ParentAttribute(string name)
public class ChildAttribute : ParentAttribute
public int Number { get; private set; }
public ChildAttribute(string name, int number)
[Child("The Beast", 666)]
public string Description { get; set; }
public DateTime SomeDate { get; set; }
public static void Main()
ChildAttribute childAttribute = typeof(Foo)
.GetProperty("Description")
.GetCustomAttribute<ChildAttribute>(true);
Console.WriteLine(((GrandpaAttribute)childAttribute).First);