Skip to content

Linq – not in

August 27, 2009
by Christian

I’m doing some work with LINQ and outer joins.

I found a few links, but it wasn’t what I was looking for.

I then thought I’d try a different direction and found this!

NorthwindDataContext dc = new NorthwindDataContext();
dc.Log = Console.Out;
var query =
from c in dc.Customers
where !(from o in dc.Orders
select o.CustomerID)
.Contains(c.CustomerID)
select c;
foreach (var c in query) Console.WriteLine( c );

This is exactly what I was after! I thought I’d share the love and post a comment – but what? I have to register to post comments???

I would be a little more understanding if Marco Russo’s site used some generic, open authentication system. But he didn’t.

(If you want to know how easy it is to implement Twitter, Facebook, OpenID or other identification methods, IT Conversations recently did a podcast on how they overcame this problem.)

Rock on!

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments.

Subscribe to this comment feed via RSS