I'm able to get the methods of a class using System.Type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)
.
However, the returned list will include "property methods", e.g. get_PropertyX
and set_PropertyX
.
How can we ensure that the returned list exclude "property methods"?
var methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
.Where(m => !m.IsSpecialName);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With