摘要:
注:(原文链接:http://developer.51cto.com/art/200909/150348.htm)本文只提供收藏,方便以后学习使用1.计数 var q = from p in db.Products group p by p.CategoryID into g select new { g.Key, NumProducts = g.Count() }; 语句描述:Linq使用Group By和Count得到每个CategoryID中产品的数量。说明:先按CategoryID归类,取出CategoryID值和各个分... 阅读全文