<p>How do you rewrite this in Linq?</p>

<pre><code>SELECT Id, Name FROM TableA WHERE TableA.Id IN (SELECT xx from TableB INNER JOIN Table C....)
</code></pre>

<p>So in plain english, I want to select Id and Name from TableA where TableA's Id is in a result set from a second query.</p>

[{'answer_id': 45648, 'author': 'John Boker', 'author_id': 2847, 'author_profile': 'https://Stackoverflow.com/users/2847', 'pm_score': 4, 'selected': True, 'text': '<pre><code>from a in TableA \nwhere (from b in TableB \n       join c in TableC on b.id equals c.id\n       where .. select b.id)\n.Contains(a.Id) \nselect new { a.Id, a.Name }\n</code></pre>\n'}, {'answer_id': 45649, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 1, 'selected': False, 'text': '<p>There is no out of box support for IN in LINQ. You need to join 2 queries.</p>\n'}, {'answer_id': 86213, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>LINQ supports IN in the form of contains.  Think "collection.Contains(id)" instead of "id IN (collection)".</p>\n\n<pre><code>from a in TableA\nwhere (\n    from b in TableB\n    join c in TableC\n        on b.id equals c.id\n    select b.id\n).Contains(TableA.Id)\nselect new { a.Id, a.Name }\n</code></pre>\n\n<p>See also this blog <a href="http://blog.wekeroad.com/2008/02/27/creating-in-queries-with-linq-to-sql/" rel="nofollow noreferrer">post</a>.</p>\n'}]
['https://Stackoverflow.com/questions/45634', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3047/']