title: c# Get if property type inherits from one abstract generic class with reflection
body: <p>I would like to get all of the properties contained in a class whose types inherit from a certain abstract and generic class. </p>
  
  <pre><code>public abstract class foo&lt;T&gt; { }
  
  public class fooInt_Indexed : foo&lt;int&gt; { }
  public class fooInt_Not_Indexed : foo&lt;int&gt; { }
  public class fooString_Compressed : foo&lt;string&gt; { }
  public class fooString_Indexed : foo&lt;string&gt; { }
  public class fooFloat : foo&lt;float&gt; { }
  
  public abstract class bar
  {
  
  }
  
  public class foobar : bar
  {
      public fooInt_Indexed value { get; set; }
      public fooInt_Not_Indexed someOtherValue { get; set; }
      public fooFloat someFloat { get; set; }
      public otherData&lt;int&gt; {get; set; }
  }
  
  public class barChecker&lt;T&gt; where T : bar
  {
      public List&lt;PropertyInfo&gt; fooprops = new List&lt;PropertyInfo&gt;();
      public static barChecker&lt;T&gt; Generator()
      {
          var @new = new barChecker&lt;T&gt;();
          foreach (var item in typeof(T).GetProperties())
          {
              if (item.PropertyType is somesortof(foo&lt;&gt;)) @new.fooprops.Add(item);
          }
          return @new;
      }
  </code></pre>
  
  <p>What do I need to put inside the <code>barChecker&lt;T&gt;</code> class code to make its fooprops list contain the property infos of "value","someOtherValue" and "someFloat" when generated as a <code>barChecker&lt;foobar&gt;</code> ?</p>