sql server - Convert SQL to LINQ to Entities WHERE IN clause -
how can convert sql statetment linq entities?
sql statement:
select * departments departmentid in (select departmentid employees firstname '%firstname%' or lastname '%lastname%')
all have =(equals) , can't in clause
linq entities:
from t in db.departments t.departmentid == -->should in not equals ((from t0 in db.employees t0.firstname.contains("firstname") || t0.lastname.contains("lastname") select new { t0.departmentid }).firstordefault().departmentid) select t
(from d in db.departments join e in db.employees on d.departmentid equals e.departmentid e.firstname.contains("firstname") || e.lastname.contains("lastname") select t).distinct()
Comments
Post a Comment