I reflect on an object and I want only public properties of an instance, I do not want public static properties. The problem is that it GetProperties()returns both static and public. Anyone have an idea how best to approach this issue?
private IOrderedEnumerable<PropertyInfo> GetSortedPropInfos()
{
return dataExtractor.GetType().GetProperties().OrderBy(
p => p.Name );
}
Notice, I am sorting the list, since it GetProperties()does not indicate any type of ordering, and ordering is important to me.
source
share