<p>So what I have right now is something like this:</p>

<pre><code>PropertyInfo[] info = obj.GetType().GetProperties(BindingFlags.Public);
</code></pre>

<p>where <code>obj</code> is some object.</p>

<p>The problem is some of the properties I want aren't in <code>obj.GetType()</code> they're in one of the base classes further up.  If I stop the debugger and look at obj, the I have to dig through a few "base" entries to see the properties I want to get at.  Is there some binding flag I can set to have it return those or do I have to recursively dig through the <code>Type.BaseType</code> hierarchy and do <code>GetProperties</code> on all of them?</p>

If you access
```
Type.BaseType
```
, you can get the base type. You can recursively access each base type and you'll know when you've hit the bottom when your type is
```
System.Object
```
.
```
```
Type type = obj.GetType();
PropertyInfo[] info = type.GetProperties(BindingFlags.Public);
PropertyInfo[] baseProps = type.BaseType.GetProperties(BindingFlags.Public);
```
```