First way:
var query =
from c in dc.Customers
where dc.Orders.FirstOrDefault(o=>o.CustomerID == c.CustomerID) == null
select c;
Second way:
var query =
from c in dc.Customers
where !(from o in dc.Orders
select o.CustomerID)
.Contains(c.CustomerID)
select c;
http://introducinglinq.com/blogs/marcorusso/archive/2008/01/14/the-not-in-clause-in-linq-to-sql.aspx
No comments:
Post a Comment