title: The query contains references to items defined on a different data context
body: <p>I have 2 var from same DBs, after union:</p>
  
  <pre><code>var projectedP1 = P1.Select(x =&gt; new Project_test { 
                                       ID_inString = x.ID.ToString(), 
                                       col1 = x.col1, 
                                       col2 = x.col2, 
                                       col3 = x.col3 });
  var union = projectedP1.Union(P2);
  </code></pre>
  
  <p>when P1 alone or P2 alone, everything is fine
  But when 2 is union, i get this in run-time:</p>
  
  <p>The query contains references to items defined on a different data context.</p>
  
  <p>I tried this similar post, but dun understand. ANyone has any idea?</p>
  
  <p><a href="https://stackoverflow.com/questions/4503202/the-specified-linq-expression-contains-references-to-queries-that-are-associated">The specified LINQ expression contains references to queries that are associated with different contexts</a></p>