C# How can I make an extension accept IEnumerable instead of array for params <p>Having this extension </p> <pre><code> public static bool In&lt;T&gt;(this T t, params T[] values) { return values.Contains(t); } </code></pre> <p>wanted it to accept IEnumerable and casting to array if needed inside the extension, but I don't know how to use the params keyword for that.</p> <p>Tryed :</p> <pre><code> public static bool In&lt;T&gt;(this T t, params IEnumerable&lt;T&gt; values) { return values.Contains(t); } </code></pre> <p>but this generates a compile-time error : <strong>The parameter array must be a single dimensional array</strong></p> <p>Is there any way to make the extension method support IEnumerable params ? if not, why not ?</p>