select COUNT([User].UserId)
from [User] join Team on [User].TeamId = Team.TeamId where Team.TeamId =2
这是我目前所拥有的,但我无法弄清楚如何实施
var countUser = from u in db.Users
join t in db.Teams
on u.TeamId equals t.TeamId
where (u.TeamId == 11)
select new
{
};
答案 0 :(得分:0)
试试这个
var countUser = (from u in db.Users
join t in db.Teams
on u.TeamId equals t.TeamId
where (u.TeamId == 11)
select new
{
u.UserId
}).Count();