title: c# Linq - Get all elements that contains a list of integers
body: <p>I have a <strong>list of Objects</strong> with a list of types inside of each Object, somthing very similar like this:</p>
  
  <pre><code>public class ExampleObject
  {
      public int Id {get; set;}
      public IEnumerable &lt;int&gt; Types {get;set;}
  }
  </code></pre>
  
  <p>For example:</p>
  
  <pre><code>var typesAdmited = new List&lt;int&gt; { 13, 11, 67, 226, 82, 1, 66 };
  </code></pre>
  
  <p>And inside the list of Object I have an object like this:</p>
  
  <pre><code>Object.Id = 288;
  Object.Types = new List&lt;int&gt; { 94, 13, 11, 67, 254, 256, 226, 82, 1, 66, 497, 21};
  </code></pre>
  
  <p>But when I use linq to get all Object who has the types admited I get any results.
  I am trying this:</p>
  
  <pre><code>var objectsAdmited = objects.Where(b =&gt; b.Types.All(t =&gt; typesAdmited.Contains(t)));
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>var typesAdmited = new List&lt;int&gt; { 13, 11, 67, 226, 82, 1, 66 };
  
  var objectNotAdmited = new ExampleObeject {Id = 1, Types = new List&lt;int&gt; {13,11}}; 
  var objectAdmited = new ExampleObject {Id = 288, Types = new List&lt;int&gt; { 94, 13, 11, 67, 254, 256, 226, 82, 1, 66, 497, 21}};
  
  var allObjects = new List&lt;ExampleObject&gt; { objectNotAdmited, objectAdmited };
  
  var objectsAdmited = allObjects.Where(b =&gt; b.Types.All(t =&gt; typesAdmited.Contains(t)));
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>objectsAdmited = { }
  </code></pre>
  
  <p>And it should be:</p>
  
  <pre><code>objectsAdmited = { objectAdmited }
  </code></pre>