-3
public class Parent
{
public Child Child1 { get; set; }
public Child Child2 { get; set; }
public Child Child3 { get; set; }
}
public class Child
{
public string Name { get; set; }
}
對linq來說有點新鮮。Linq查詢獲取對象的變量值
想使用反射
下面了檢索所有即Child1,CHILD2,Child3的名稱值是我可以從反射看到的樣子。
Parent p = new Parent();
p.Child1.GetType()。GetProperties()。ToList();
我看到從下面父p中反射的方式=新Logic.Parent(); ()GetErpert1.GetType()。GetProperties()。ToList() –