/ Published in: C#
Note that .Except is a great option too, but only if you're dealing with a list of value types (it doesn't work with complex types unless you implement an iEqualityOperator)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
from c in dc.Customers where !(from o in dc.Orders select o.CustomerID) .Contains(c.CustomerID) select c;
URL: http://stackoverflow.com/questions/183791/how-would-you-do-a-not-in-query-with-linq