Question: I want to get the list of properties for an object of a specific type, I have made this static method to do the job.

ex: class A have 3 bool properties, calling GetPropertiesList< bool>(aInstance); will return a list with all the bool returning properties.

Is that ok or am I reinventing the wheel here? 

```
    public static List<T> GetPropertiesList<T>(object obj)
    {
        var propList = new List<T>();
        PropertyInfo[] properties = obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
        //search
        foreach (PropertyInfo prop in properties)
        {
            if (prop.PropertyType != typeof(T)) { continue; }

            else
            {
                //Add to list
                var foundProp = (T)prop.GetValue(obj, null);
                propList.Add(foundProp);
            }
        }
        return propList;
    }

```

Answer: 
This won't work if `PropertyType` is a subclass of `T`. For example, if you have this class:

```
class SomeImages{
    public Bitmap Img1{get;set;}
    public Image Img2{get;set;}
}

```

Then `GetProperties<Image>(instanceOfSomeImages)` will only return Img2. Similarly, `GetProperties<Bitmap>(instanceOfSomeImages)` will only return Img1.

Instead of doing your check as `prop.PropertyType != typeof(T)`, you should probably do `typeof(T).IsAssignableFrom(prop.PropertyType)`.

Finally, it's a little sloppy to have a `if(not isGood){continue;}else{doSomething;}`. It is much simpler to do `if(isGood){doSomething;}`.
You can use LINQ to shorten your query, eg:

```
obj.GetType()
   .GetProperties(BindingFlags.Public | BindingFlags.Instance)
   .Where(p=>typeof(T).IsAssignableFrom(p.PropertyType))
   .Select(p=>(T)p.GetValue(obj,null))
   .ToList();

```

**UPDATE**

You can also check the [Type.FindMembers](http://msdn.microsoft.com/en-us/library/system.type.findmembers.aspx) method which accepts a [MemberFilter](http://msdn.microsoft.com/en-us/library/system.reflection.memberfilter.aspx) delegate to filter the members it returns, but I don't think it would be much simpler or faster