title: Select multiple columns using Entity Framework
body: <p>Maybe an easy question, but can't find it easily so forgive me =)
  I try to select multiple columns. The statement I use is:</p>
  
  <pre><code>var dataset2 = from recordset in entities.processlists 
                 where recordset.ProcessName == processname 
                 select recordset.ServerName, recordset.ProcessID, recordset.Username;
  </code></pre>
  
  <p>Obviously, this doesn't even compile. What is the correct syntax?
  I also tried method based, and even tough this syntax seems correct, when accessing it throws an 'Unable to cast the type 'Anonymous type' to type 'AIM.PInfo'. LINQ to Entities only supports casting EDM primitive or enumeration types.' exception.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>var dataset = entities.processlists
               .Where(x =&gt; x.environmentID == environmentid &amp;&amp; x.ProcessName == processname &amp;&amp; x.RemoteIP == remoteip &amp;&amp; x.CommandLine == commandlinepart)
               .Select(x =&gt; new { x.ServerName, x.ProcessID, x.Username })
               .Cast&lt;PInfo&gt;().ToList();
  </code></pre>