public class ReflectionBase
{
public String ParentProperty1 { get; set; }
public String ParentProperty2 { get; set; }
}
public class Reflection : ReflectionBase
{
public String ChildProperty1 { get; set; }
public Reflection()
{
var property = this.GetType().GetProperties();
}
}
结果:
ParentProperty1
ParentProperty2
ChildProperty1
我需要:
ChildProperty1
当我调用 GetProperties() 它给了我所有当前类属性和基类,但我只需要当前类属性。
任何帮助请...