You cannot use existing Action delegates with params , but you can declare your own delegate this way:
public delegate void ParamsAction(params object[] arguments)
Then:
// Note that this doesn't have to have params, but it can do public void Foo(object[] args) { // Whatever } ... ParamsAction action = Foo; action("a", 10, 20, "b");
Of course, you can create an Action<object[]> for your existing method, but you will lose its params , as it is not declared in Action<T> . For example:
public static void Foo(params object[] x) { } ... Action<object[]> func = Foo; func("a", 10, 20, "b");
So, if you call a delegate from code that wants to use params , you need a delegate type that includes the declaration (according to the first part). If you just want to create a delegate that accepts object[] , then you can create an instance of Action<object[]> using a method that has params in its signature - it's just a modifier, efficient.
source share