2011-07-12 35 views

回答

7

喜歡的東西:

var query = from item in db.MemberReactions 
      where item.ID == id 
      group item by item.Reaction into g 
      select new { Reaction = g.Key, Count = g.Count() }; 

(其中id就是你要找的ID - 作爲一個GUID,或字符串,或任何合適的類型。)

+0

'反應到g'那是我錯過的。謝謝。 – BrunoLM

相關問題