C# force inherited class looping through list
<p>So for example I have two classes:</p>

<pre><code>Class A
{
  string property1;
  string property2;
}

Class B : A
{
  string property3;
  string property4;
  ....
} 
</code></pre>

<p>So B inherits class A's properties. They are sitting in a list, that is sitting in a dictionary </p>

<pre><code>Dictionary &lt;string, List&lt;A&gt;&gt; myDictionary = new Dictionary&lt;string, List&lt;A&gt;&gt;();

List&lt;A&gt; myList = new List&lt;A&gt;();
</code></pre>

<p>There is one Dictionary, containing many List's, that all contain a mix of Class A &amp; B objects. 
While looping through, I am trying to access some properties from Class B objects, I have an if statement to find them but the program still thinks they are of type Class A and throws an error when I try and use a property3 or property4. For example: </p>

<pre><code>string key = string key in dictionary;
string index = object position in list;

myDictionary[key][index].property3.someMethod();
</code></pre>

<p>Is there a way to tell the program that this is a class B object and allow the properties 3 &amp; 4 to be used?</p>
