public class parent
{
public string abc { get; set; }
public childclass pos { get; set; }
}
public class childclass
{
public string value { get; set; }
}
我目前正在阅读父类的合集
var obj =
(from dia in parent
select new
{
abc = dia.abc,
pos = new childclass()
{
value = dia.pos.value
},
})
.ToList();
如何使用 linq to object 读取嵌套类子类,这块不起作用
pos = new childclass()
{
Value = dia.pos.Value
},
请指教