title: Projection to select elements from List<T>
body: <p>I have a class</p>
  
  <pre><code>public class MyClass
  {
    public p1 {get; set}
    public p2 {get;set;}
    public p3 {get;set;}
  }
  </code></pre>
  
  <p>and a generic list <code>List&lt;MyClass&gt; myList</code>.</p>
  
  <p>I know that I can write</p>
  
  <pre><code>var myvar = from x in myList select new {x.p1, x.p2};
  </code></pre>
  
  <p>How do I write a projection to select only p1 and p2 from MyList using extension Select method?</p>
  
  <pre><code>myList.Select(????
  </code></pre>
  
  <p>Documentation <a href="https://msdn.microsoft.com/en-us/library/bb548891(v=vs.110).aspx" rel="nofollow">Enumerable.Select</a> only shows how to select single value</p>
  
  <pre><code>IEnumerable&lt;int&gt; squares =
      Enumerable.Range(1, 10).Select(x =&gt; x * x);
  </code></pre>