0
select COUNT([User].UserId)
from [User] join Team on [User].TeamId = Team.TeamId where Team.TeamId =2
這裏是我到目前爲止,但我無法弄清楚如何實現需要轉換成SQL連接與數查詢到LINQ,並通過它來查看
var countUser = from u in db.Users
join t in db.Teams
on u.TeamId equals t.TeamId
where (u.TeamId == 11)
select new
{
};
這裏是一個非常好的開始學習Linq的好地方,它有很多例子[C#Linq Examples](http://www.dotnetperls.com/linq) – MethodMan 2014-11-04 17:51:04