title: Union IQueryable and List
body: <p>This is my code:</p>
  
  <pre><code>var query = context.SomeEntities.Select(e =&gt; new SomeDto
  {
      Name = e.Title,       
  })
  </code></pre>
  
  <p>The variable query is IQueryable.</p>
  
  <pre><code>var list = new List&lt;SomeDto&gt;
  {
      new SomeDto
      {
            Name = "SomeName1"      
      },
      new SomeDto
      {
            Name = "SomeName2"      
      }
  };
  </code></pre>
  
  <p>Now I need union these collections,I write</p>
  
  <pre><code>query = query.Union(list)
  </code></pre>
  
  <p>But in this place I get exception </p>
  
  <blockquote>
    <p>Unable to create a constant value of type 'SomeDto'. Only primitive types or enumeration types are supported in this context</p>
  </blockquote>
  
  <p>I know that I can do ToList() for first collection,but I need union collections without call to database.How can I do this?</p>