title: How to specify default value for List<> parameter in a c# function?
body: <p>I've got a C# method that takes a bunch of parameters, all of which have default values. One of the parameters is a List. I can't figure out how to specify that the List should default to empty. Here's what it looks like:</p>
  
  <pre><code>    public static void execute(
          String condition = "Unnamed condition",
          List&lt;String&gt; messages,
          Object actual    = null,
          Object expected  = null)
  </code></pre>
  
  <p>I can't quite figure out how to specify that messages should be empty by default. When I enter:</p>
  
  <pre><code>...
  List&lt;String&gt; messages = new List&lt;String&gt; ()
  ...
  </code></pre>
  
  <p>it complains that "default parameter value for 'messages' must be a compile-time constant".</p>
  
  <p>Any ideas?</p>