lundi 25 juillet 2016

Select values from two tables using “WHERE NOT IN” and DISTINCT in LINQ in Linq to Sql

I have two table like Customer and VisitDetail and i need to convert below SQL Query into Linq to Sql

select *
from Customer
where id not in (select distinct CustomerId
                 from visitdetail
                 where VisitDate='2016-06-13' and SalesRepAccId=1 and
                       RouteId=10
                ) and
      RouteId = 10 and Active=1 and SalesRepAccId=1

Aucun commentaire:

Enregistrer un commentaire