SELECT * FROM User
INNER JOIN Role ON User.User_ID = Role.User_User_ID
WHERE User.User_ID=’5’ OR Role.Role_Desc = ’admin’
答案 0 :(得分:2)
也许是这样的:
var result=
(
from u in db.Users
join r in db.Roles
on u.User_ID equals r.User_User_ID
where u.User_ID==5 || r.Role_Desc == "admin"
select new
{
User=u,
Role=r
}
).ToList();
其中db
是linq数据上下文