title: Linq: select objects where list contains properties that must be in another list
body: <p>I've read many solutions using linq and lists, but I can't seem to find a solution to my issue. I've described the situation below. The list of Details includes every detail in the system.</p>
  
  <pre><code>List&lt;Detail&gt; allDetails
  
  Detail
      List&lt;Program&gt; programs
  
  Program
      int ID
      int code
  </code></pre>
  
  <p>I have a list of program IDs a specific role has access to.</p>
  
  <pre><code>int[] specificPrograms
  </code></pre>
  
  <p>The requirement is that I need to return a list of Details from allDetails where the list of programs for a Detail in allDetails must all be contained in specificPrograms list. </p>
  
  <p>For example: If there are 2 details containing the following programs</p>
  
  <pre><code>Detail 1
  Programs   ID        Code
  ---------------------------------
             1         111
             2         222
             3         333
             4         444
  
  Detail 2
  Programs   ID        Code
  ---------------------------------
             1         111
             3         333 
  
  SpecificPrograms contains IDs: 1, 3, 4
  </code></pre>
  
  <p>Only Detail 2 would be returned because the programs in each detail must exist in the specificPrograms list.</p>