title: Passing array to function that takes either params object[] or IEnumerable<T>
body: <p>I want to pass an array of custom objects to a function like <code>String.Join</code> which has the following signatures:</p>
  
  <ul>
  <li><code>public static string Join(string separator, params Object[] values)</code></li>
  <li><code>public static string Join(string separator, IEnumerable&lt;T&gt; values)</code></li>
  </ul>
  
  <p>If I call the function like this:</p>
  
  <pre><code>var arr = new MyClass[]{ new MyClass(), new MyClass() };
  string text = string.Join("\n", arr);
  </code></pre>
  
  <p>I get a compiler error:</p>
  
  <blockquote>
    <p>The call is ambiguous between the following methods or properties: 'string.Join(string, params object[])' and 'string.Join(string, System.Collections.Generic.IEnumerable)'</p>
  </blockquote>
  
  <p>I can resolve the ambiguity by using the <code>IEnumerable&lt;T&gt;</code> function:</p>
  
  <pre><code>var arr = new MyClass[]{ new MyClass(), new MyClass() };
  string text = string.Join&lt;MyClass&gt;("\n", arr);
  </code></pre>
  
  <p>But can I call the <code>params object[]</code> function?</p>
  
  <p>I am using C# 4.0, if that makes any difference.</p>