Inheritance related question
<p>I have a class Base. A and B extend Base. There is also a class Relationship which contains two Base objects (source, target). Is it possible to determine whether source/target is an A or B instance?</p>

<p>Thanks.</p>

<p>Christian</p>

<p>PS: </p>

<p>Here is a little add on. I am using automapper and I would like to map the type of source/target to a string called 'Type' - GetType did not work <strong>(actually it works -s ee my comments - is and as are good solutions too)</strong>:</p>

<pre><code>Mapper.CreateMap&lt;Item, ItemViewModel&gt;()
                .ForMember(dest =&gt; dest.Name, opt =&gt; opt.MapFrom(src =&gt; src.ItemName == null ? "" : src.ItemName.Name))
                .ForMember(dest =&gt; dest.Type, opt =&gt; opt.MapFrom(src =&gt; src.GetType().ToString()));
</code></pre>

<p>How can I use is/as in this scenario?</p>
