I am using Entity Framework
Therefore, I want to write a sql command using two tables - the tblContractor and tbSiteByCont tables. It is like SQL
SELECT PKConID, Fname, Lname FROM tblContractor WHERE (PKConID NOT IN (SELECT FKConID FROM tbSiteByCont WHERE (FKSiteID = 13)))
but I donβt know how to write in Linq.
I tried like this
var query1 = from s in db.tblSiteByConts where s.FKSiteID == id select s.FKConID; var query = from c in db.tblContractors where c.PKConID != query1.Any() select Contractor;
But that does not work. So how do I write it? What is the procedure? I am new to Linq.
source share