title: typeof( ICollection<> ).GetTypeInfo().IsAssignableFrom( typeof(IList<>) )
body: <p>I am trying to check the following</p>
  
  <pre><code>typeof( ICollection&lt;&gt; ).GetTypeInfo().IsAssignableFrom( targetProperty.PropertyType.GetTypeInfo() )
  </code></pre>
  
  <p>where the argument passed into <code>IsAssignableFrom</code> is an <code>IList&lt;Something&gt;</code>.  But it is returning false.</p>
  
  <p>The following also returns false.</p>
  
  <pre><code>typeof( ICollection&lt;&gt; ).GetTypeInfo().IsAssignableFrom( targetProperty.PropertyType.GetTypeInfo().GetGenericTypeDefinition() )
  </code></pre>
  
  <p>Even the following is returning false.</p>
  
  <pre><code>typeof( ICollection&lt;&gt; ).GetTypeInfo().IsAssignableFrom( typeof(IList&lt;&gt;) )
  </code></pre>
  
  <p>Shouldn't the latter definitely return true?</p>
  
  <p>How can I get the correct result when <code>targetProperty.PropertyType</code> can be any type at all?  It could be a <code>List&lt;T&gt;</code>, an <code>ObservableCollection&lt;T&gt;</code>, a <code>ReadOnlyCollection&lt;T&gt;</code>, a custom collection type, etc.</p>