【发布时间】:2009-11-25 10:57:03
【问题描述】:
我有一个类似这样的 T-SQL 查询:
SELECT r_id, r_name, count(*)
FROM RoomBindings
GROUP BY r_id, r_name
我想用 LINQ 做同样的事情。到目前为止,我到了这里:
var rooms = from roomBinding in DALManager.Context.RoomBindings
group roomBinding by roomBinding.R_ID into g
select new { ID = g.Key };
如何提取 count(*) 和 r_name 部分?
【问题讨论】:
-
谢谢狗!我已经找了差不多 2 个小时了!
:facepalm: