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받을 수 있나요 차일을 얼마나 여기
은?
var childs = parents.SelectMany(p => p.relatedchilds);
또는 쿼리 형식 : relatedchilds
이후
와우 .. 감사합니다. – Luke101