title: Variable parameters in C# Lambda
body: <p>Is it possible to have a C# lambda/delegate that can take a variable number of parameters that can be invoked with a Dynamic-invoke?</p>
  
  <p>All my attempts to use the 'params' keyword in this context have failed.</p>
  
  <hr>
  
  <p><strong>UPDATE WITH WORKING CODE FROM <a href="https://stackoverflow.com/a/3581142/783175">ANSWER</a>:</strong></p>
  
  <pre><code>delegate void Foo(params string[] strings);
  
  static void Main(string[] args)                       
  {
      Foo x = strings =&gt;
      {
          foreach(string s in strings)
              Console.WriteLine(s);
      };
  
      //Added to make it clear how this eventually is used :)
      Delegate d = x;
  
      d.DynamicInvoke(new[]{new string[]{"1", "2", "3"}});
  }
  </code></pre>