1
我需要一個所有孩子的列表。我將如何去獲取只有兒童項目。如何使用linq查詢獲取所有孩子
這裏是我如何讓孩子的
//lets get the parents along with the childs
var parents = from p in context.post
where p.isDeleted == false && p.userid == new Guid(UserID)
let relatedchilds = from c in context.post
where c.id == p.id
select c.id
select new
{
p.id,
p.userid,
relatedchilds
}
//now lets get only the childs in the previous query
var childs = from c in parents
select new
{
c.relatedchilds. //This is where my problem is
}
如何我只得到一列內relatedchilds?
哇..謝謝你.. – Luke101 2011-04-06 01:18:04