Trying to get a string that represents a class heirachy
<pre><code>class Base
{
}
class A: Base
{
}
class B:A
{
}
</code></pre>

<p>I want to be able to get for an instance of B the string "Base.A.B"</p>

<p>Of course I could simply do</p>

<pre><code>class B:A
{
   const string NAME = "Base.A.B";
}
</code></pre>

<p>But thats kind of fragile, if I change things I have to change it in many places</p>

<p>I started out with</p>

<pre><code>class Base
{
protected string Name {get{return typeof(Base).Name;}};
}
</code></pre>

<p>With the dea of each class hierarchy level calling its base.Name method. But again I have now had to name Base twice (admittedly it will fail at compile time if I forget) but it still seems fragile.</p>
