title: How to determine if an object inherits from an abstract generic class
body: <p>I have a generic abstract class which I derive from:</p>
  
  <pre><code>abstract class SuperClass&lt;T&gt;
  where T : SuperDataClass
  
  abstract class SuperDataClass
  </code></pre>
  
  <p>The data type is limited to SuperDataClass, so every concrete data type must inherit from SuperDataClass.
  In the end I have pairs of SuperClass and SuperDataClass inheriters, e.g.:</p>
  
  <pre><code>class DataClassA : SuperDataClass
  class ClassA : SuperClass&lt;DataClassA&gt;
  
  class DataClassB : SuperDataClass
  class ClassB : SuperClass&lt;DataClassB&gt;
  </code></pre>
  
  <p>How can I check if an object, e.g. ClassA inherits from SuperClass without knowing the possible data type?</p>
  
  <p>I tried the following, which does not work:</p>
  
  <pre><code>if (testObject.GetType().IsAssignableFrom(typeof(SuperClass&lt;SuperDataClass&gt;))) {
      Console.WriteLine("The test object inherits from SuperClass");
  }
  </code></pre>
  
  <p>So how does the if-statement needs to look like?</p>