When i call
Type.GetProperties(BindingFlags.Public | BindingFlags.Instance)
I also get properties with [] operators. So, for example, I have:
MyType
-> Property1
-> Property2[string]
And the returned PropertyInfo list contains both Property1 and Property2.
How can I exclude properties with operators?
I would prefer this to happen via BindingFlags, but iterating over the afterwords from PropertyInfo would be fine, but I can't see anything on the PropertyInfo class that indicates whether this has an operator.
source
share