title: C# passing a list of strongly typed property names
body: <p>I'm looking for a way to pass in a list of strongly typed property names into a method that I can then dissect and get the properties that the caller is interested in. The reason I want to do this is to have a copy method that only copies the fields the user specifies. Right now, the method takes a list of strings to use with the Getvalues and get properties methods in reflection, but I want to guard against refactoring of properties and the strings not being updated by the developer.</p>
  
  <p>I found this article <a href="https://stackoverflow.com/questions/13074202/passing-strongly-typed-property-name-as-argument">Here</a>, but unfortunately, it does not do a list.  I can do something like:</p>
  
  <pre><code>public static void Copy(Expression&lt;Func&lt;TObject&gt;&gt; propertiesToCopy )
  {
  }
  </code></pre>
  
  <p>And then have the caller do</p>
  
  <pre><code>PropertyCopier&lt;List&lt;string&gt;&gt;.Copy(() =&gt; data);
  </code></pre>
  
  <p>But then I have to specify how many properties the caller can have like this:</p>
  
  <pre><code>public static void Copy(Expression&lt;Func&lt;TObject&gt;&gt; propertiesToCopy,Expression&lt;Func&lt;TObject&gt;&gt; propertiesToCopy2, Expression&lt;Func&lt;TObject&gt;&gt; propertiesToCopy3 )
  {
  }
  </code></pre>
  
  <p>This would allow for three properties. Is there anyway to add it to a List or Queryable&lt;> to allow as many properties as the caller wants? I tried using the Add in List and having the Expression
  
  <p>Thanks in advance</p>
  
  <p>Edit: I did find a few articles this evening that refer to using the C# <strong>param</strong> keyword to accomplish this. Are there any better or more efficient ways, or is this the best way to do it?</p>