Passing object as an argument to a System.Action

I am trying to create a feature that will allow developers to create a button and pass object as arguments.

Following set up works but I want to take this to new level where user can define object as an argument for the buttonAction

public Button AddButton (string buttonLabel, System.Action buttonAction)
{

        GameObject newButton;			
		newButton = Instantiate (ButtonTemplate); //ButtonTemplate prefab 

		//Change button settings
		newButton.name = buttonLabel;
		newButton.GetComponentInChildren<Text> ().text = buttonLabel;

		Button newButtonComponent = newButton.GetComponentInChildren<Button>();

		//Add a listener for the button action when it is clicked
		newButtonComponent.onClick.AddListener ( () =>  buttonAction ());

		return newButtonComponent;
}

I am getting an error whenever I try to do this:

public Button AddButton (string buttonLabel, System.Action<object> buttonAction, object args)

{
     //..........same stuff

    //Add a listener for the button action when it is clicked
    newButtonComponent.onClick.AddListener ( (args) =>  buttonAction (args));

    return newButtonComponent;

}

error CS0136: A local variable named args' cannot be declared in this scope because it would give a different meaning to args’, which is already used in a `parent or current’ scope to denote something else

The answer is as simple as

public Button AddButton (string buttonLabel, System.Action<object> buttonAction, object args)
 
 {
      //..........same stuff
 
     //Add a listener for the button action when it is clicked
     newButtonComponent.onClick.AddListener ( () =>  buttonAction (args));
 
     return newButtonComponent;
 
 }

To take this one step further…

 public Button AddButton (string buttonLabel, System.Action<object[]> buttonAction, params object args)
     
     {
          //..........same stuff
     
         //Add a listener for the button action when it is clicked
         newButtonComponent.onClick.AddListener ( () =>  buttonAction (args));
     
         return newButtonComponent;
     
     }

Now you have n number of arguments