SELECT * FROM User
INNER JOIN Role ON User.User_ID = Role.User_User_ID
WHERE User.User_ID=’5’ OR Role.Role_Desc = ’admin’
Asked
Active
Viewed 76 times
-2

jarlh
- 42,561
- 8
- 45
- 63
-
[http://stackoverflow.com/questions/8988531/convert-sql-to-linq-query] – User Learning Jun 04 '15 at 08:45
-
2Please show us your attempt, and also tag the language (e.g. C#) – StuartLC Jun 04 '15 at 08:45
-
possible duplicate of [SQL to LINQ Tool](http://stackoverflow.com/questions/296972/sql-to-linq-tool) – atw Jun 04 '15 at 08:49
1 Answers
2
Maybe something like this:
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();
Where db
is the linq data context

Arion
- 31,011
- 10
- 70
- 88