0
我試圖從一個表中創建新的匿名類型的表中獲取公司名稱。如果我註釋掉「公司名稱」行,則查詢起作用Linq Group By with Count and Key Name
db.tbl
.GroupBy(a => a.ID)
.Select(b => new {
// This line is where I need help, I want to grab the company name
CompanyName = b.GroupBy(x=>x.CustomerName).ToString(),
CustomerId = (int) b.Key,
TotalQuotes = b.Count()
})
這是個問題嗎,先生? – meJustAndrew
對不起,我不清楚,我如何獲得CompanyName? –
首先,「c」在哪裏? – yopez83