title: How to cast anonymous type to primitive type member using Lambda or Linq
body: <p>Hi I am trying to use Lambda Expression to cast anonymous type list to primitive type list, so far I have no luck.</p>
  
  <p>I know I can use foreach to loop through 'a' and get the values, but I want to know how to do it in Lambda or Linq.</p>
  
  <pre><code>var a = new []{ new {name= "jerry", age = 32}, new {name="peter",age=23}};
  
  List&lt;string&gt; b = a.Select(p =&gt; new System.String{p.name}).ToList();
  List&lt;int&gt; c = a.Select(p =&gt; new System.Int32{p.age}).ToList();
  </code></pre>