How do I convert this basic SQL statement to linq? -
select * user inner join role on user.user_id = role.user_user_id user.user_id=’5’ or role.role_desc = ’admin’
maybe this:
var result= ( u in db.users join r in db.roles on u.user_id equals r.user_user_id u.user_id==5 || r.role_desc == "admin" select new { user=u, role=r } ).tolist();
where db
linq data context
Comments
Post a Comment