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