Skip to content
Advertisement

How can you handle an IN sub-query with LINQ to SQL?

I’m a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL:

Any help would be gratefully received.

Advertisement

Answer

Have a look at this article. Basically, if you want to get the equivalent of IN, you need to construct an inner query first, and then use the Contains() method. Here’s my attempt at translating:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement