title: What would be the equivalent of SQL [IN] statement for C# Lambda Expression?
body: <p>I am in this scenario. I have two lists of two different object types, which both have a shared property value. Let's say that it is <code>invoiceID</code>.</p>
  
  <p>In SQL, if I want to grab all records from <code>table_A</code> given that it has column <code>invoiceID</code> value match with any <code>invoiceId</code> inside <code>table_B</code>, I would probably do something like this.</p>
  
  <pre><code>Select *
  From table_A
  where invoiceID in ( select invoiceId from table_B)
  </code></pre>
  
  <p>What would be the equivalent LINQ or Lambda expression in C# for this scenario?</p>
  
  <p>I am used to search for elements in the list using a single value such as:</p>
  
  <pre><code>var result = list_A.Where(x=&gt;x.InvoiceID = someInvoiceID) 
  </code></pre>
  
  <p>or <code>.contains()</code> instead.</p>
  
  <p>However, this could cover only a single <code>invoiceID</code> value.</p>
  
  <p>I guess, I could run the loop for each <code>invoiceID</code> on <code>list_B</code> and then store the result in another list, but I'm just wondering if there is a better way to do this?</p>