I am trying to declare a action-delegate which allows set functions with different paremeter.
Here is my minimal example: I have different void function like this:
private void Function1(string Parameter) { ... } private void Function2(int Parameter) { ... } I want to pass these functions in the same constructor. But this is not possible in this way.
Main { AClass a = new AClass(Function1); AClass b = new AClass(Function2); } How do I need to define my Action (object is not working) - I don't want to overload my consturcor!
public class AClass { public AClass(Action<???> Function) { ... } } Thank you for helping me!