c# - convert Sql with inner select to Linq -


how convert sql query linq

select *     users     join products         on users.id = products.user_id users.id in (     select id     users     users.status = 'online' ) 

well, sql complicated (the subquery useless), simplify it, , you'll easy linq...

from u in users join p in products on u.id equals p.user_id u.status == "online" select new{u, p}; 

your sql be

select *  users u join products p on u.id = p.user_id u.status = 'online'  

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -