class Parent {
public string A { get; set; }
}
class Child : Parent {
public string B { get; set; }
}
I need to get only property B, without property A
but
Child.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance)
return both properties :/
You should add BindingFlags.DeclaredOnly to your flags, i.e: