I have a class like this:
public class Foo: BaseFooClass
{
internal string Bar {
get {return "Oh My!";}
}
}
I need to retrieve the property via reflection .
What I do is:
PropertyInfo myProp= InstanceOfFoo.GetType().GetProperty("Bar");
But myProp is null. I tried with BindingFlags.Instance|BindingFlags.NonPublic
, but they yield no result. What am I doing wrong? Thanks
Aucun commentaire:
Enregistrer un commentaire