0
希望通過在linq中嘗試向下三個級別嵌套組獲得幫助。試圖按對象返回多個組
基本上路徑會下降業務到BusUnit到1級
所以下企業有各種BusUnits下BusUnits有我想回到這個各種1級值
一個Json對象。
正如我在此刻有它我下到BusUnits
如下
var queryNestedData = (from r in DataItems
group r by r.Business into businesses
from businessUnits in
(from r in businesses
group r by r.Businessunit)
group businessUnits by businesses.Key).Select(tg =>
new
{
Business = tg.Key,
BusinessUnits = tg.Select(tv => new { BusinessUnit = tv.Key })
});
我怎樣才能到1級,以便返回的值呢?
您嘗試'連接'在'LINQ'? –