title: Entity Framework: Any or All - Unable to create a constant value of type 'System.Collections.Generic.List`1'
body: <p>I am trying to do something like this:</p>
  
  <pre><code>from t in ent.myEntities
  where SelectedProperties == null || SelectedProperties.Any(le =&gt; le == t.Entity)
  select t
  </code></pre>
  
  <p>basically trying to cover 2 cases. accepting an empty list, should return all entities, or filter on the list if it is supplied. </p>
  
  <p>above actually does work when i supply the list, however in the case when it is null i get: </p>
  
  <blockquote>
    <p>Unable to create a constant value of type
    'System.Collections.Generic.List`1'. Only primitive types ('such as
    Int32, String, and Guid') are supported in this context</p>
  </blockquote>
  
  <p>also tried using this with a string array:</p>
  
  <pre><code>where arr == null || arr.Contains(t.Entity)
  </code></pre>
  
  <p>is it possible to have such a condition without having to build a predicate (which is a bigger effort)? </p>