Create an instance using a subset of properties from another instance in a type safe manner?
<p>I have a data source to which I wan't to bind a collection of X's. X should contain a subset of a certain type Y's properties (let's say Y has properties PropOne, PropTwo, PropThree)
This can of course be done with an anonymous type:</p>

<pre><code>void DoBind()
{
   myGrid.DataSource = myCollectionOfYs.Select(y =&gt; new {y.PropOne, y.PropTwo});
}
</code></pre>

<p>How can I modify this method so that the caller of it can specify which properties to use in the projection in a type safe way? I.e. something along the lines:</p>

<pre><code>var expressions = new List&lt;Expression&lt;Func&lt;Y, object&gt;&gt;&gt;();
expressions.Add(y =&gt; y.PropOne);
expressions.Add(y =&gt; y.PropTwo);
DoBind(expressions);
</code></pre>
