title: C# function parameter Array vs List
body: <p>I'm writing a simple C# class that handle SQL queries in a specific contest. Most of the queries will be <code>SELECT</code> statement with 3-4 parameters that should be escaped properly, so the function will be something like this</p>
  
  <pre><code>public DataTable Select(string query, string[] parameters) {
      # some code
  }
  </code></pre>
  
  <p>Should <code>parameters</code> be an <code>Array</code> or a <code>List&lt;&gt;</code>? Is there some best practice when choosing between these two types as function parameter or is it just a matter of preferences?</p>
  
  <p>P.S. I usually prefer <code>List&lt;&gt;</code> because of the flexibility but here the possibility to create an <code>Array</code> on the fly is a good point.</p>