将SQL转换为LINQ? [英] Converting SQL to LINQ?
本文介绍了将SQL转换为LINQ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select e.code,e.first_name,e.last_name,r.name as [Role],usr.first_name+' '+usr.last_name as Mentor
from sys_user u
right join employee e
on e.[user_id]=u.id
left join employee_relation_map er
on e.id =er.employee_id
left join employee_role_map erm
on e.id=erm.employee_id
left join role r
on erm.role_id=r.id
left join sys_user usr
on er.[user_id]=usr.id
where e.first_name='ashwini' and (erm.Effective_Upto is null or erm.Effective_From <= getdate()) and (erm.Effective_Upto is null or erm.Effective_Upto >= getdate())
and (er.Effective_Upto is null or er.Effective_From <= getdate())
and (er.Effective_Upto is null or er.Effective_Upto >= getdate())
请告诉我如何将这个SQL语句转换成LINQ。
Please tell me how to convert this SQL statement into LINQ.
推荐答案
使用像 LINQPad [ ^ ],它会节省你很多时间
Use tools like LINQPad[^], it'll save you lot of time
这篇关于将SQL转换为LINQ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文