I’m a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL:
SELECT f.* FROM Foo f WHERE f.FooId IN ( SELECT fb.FooId FROM FooBar fb WHERE fb.BarId = 1000 )
Any help would be gratefully received.
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: