title: Linq UNION query to select two elements
body: <p>I want to select 2 elements from my database table using <code>LINQ</code> query and I saw an example which use <code>UNION</code> I don't have much experience but I think that maybe this is what I need but I get an error which I can not fix and I'm not sure if it's fixable anyway. So here is my query:</p>
  
  <pre><code>    IList&lt;String&gt; materialTypes = ((from tom in context.MaterialTypes
                                     where tom.IsActive == true
                                     select tom.Name)
                                     .Union(from tom in context.MaterialTypes
                                     where tom.IsActive == true
                                     select (tom.ID))).ToList();
  </code></pre>
  
  <p>Which as it seems is complaining about trying to use <code>UNION</code> on <code>IQueryable</code> with <code>IEnumarebale</code>. I tried to fix that by adding <code>ToString()</code> like this - <code>(tom.ID).ToString</code> which led to cleaning the error underline in <code>Visual-Studio-2010</code> but in runtime I get:</p>
  
  <pre><code>{"LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression."}
  </code></pre>
  
  <p>Ty, Leron.</p>