title: How can I work around Type.IsAssignableFrom not working with inherited interfaces?
body: <p>I've made a test case to illustrate the problem I've run into.</p>
  
  <p>The first assert passes, but the second and third both fail. </p>
  
  <p>Is there a way to check either of the two failing conditions k in a different way that will work? It would be OK if it's not terribly fast as I intend to cache the results on a per-type basis.</p>
  
  <pre><code>public interface IParentInterface
  {
  
  }
  
  public interface IChildInterface : IParentInterface
  {
  
  }
  
  public class ParentClass&lt;T&gt; where T: IParentInterface
  {
  
  }
  
  public class ChildClass : ParentClass&lt;IChildInterface&gt;
  {
  
  }
  
  public class TestClass
  {
      public ChildClass Property { get; set; }
  }
  
  [TestFixture]
  public class ScratchPad
  {
  
      [Test]
      public void Assignabl()
      {
          var tc = new TestClass();
          var tct = tc.GetType();
  
          var pi = tct.GetProperty("Property");
  
          Assert.IsNotNull(pi);
  
          Assert.IsTrue(typeof(ParentClass&lt;IChildInterface&gt;).IsAssignableFrom(pi.PropertyType));
          Assert.IsTrue(typeof(ParentClass&lt;&gt;).IsAssignableFrom(pi.PropertyType));
          Assert.IsTrue(typeof(ParentClass&lt;IParentInterface&gt;).IsAssignableFrom(pi.PropertyType));
  
      }
  
  }
  </code></pre>