how to combine two linq query result set into one using C#
<p>I want to combine two LINQ query results into one:</p>

<pre><code>var query1 = from sn in code                                        
             group sn by sn.Substring(0, 10) into g
             select new
             {
               Key = g.Key,
               Cnt = g.Count(),
               Min = g.Min(v =&gt; v.Substring(10, 4)),
               Max = g.Max(v =&gt; v.Substring(10, 4))
             };
var query2 = from sn1 in codes
             group sn1 by sn1.Substring(0, 11) into g
             select new
             {
               key = g.Key,
               Cnt = g.Count(),
               Min = g.Min(v =&gt; v.Substring(11, 4)),
               max = g.Max(v =&gt; v.Substring(11, 4))
             };
var query3= query1.Union(query2)
</code></pre>

<p>but on compilation I get an error:</p>

<blockquote>
  <p>'<code>System.Collections.Generic.IEnumerable&lt;AnonymousType#1&gt;</code>' does not
  contain a definition for '<code>Union</code>' and the best extension method
  overload
  '<code>System.Linq.Queryable.Union&lt;TSource&gt;(System.Linq.IQueryable&lt;TSource&gt;,
  System.Collections.Generic.IEnumerable&lt;TSource&gt;)</code>' has some invalid
  arguments</p>
</blockquote>

<p>what's wrong with my code?</p>
