Question: I have a method that I call multiple times, but each time a different method with a different signature is called from inside. 

```
public void MethodOne()
{
//some stuff

*MethodCall();

//some stuff

}

```

So `MethodOne` is called multiple times, each time with a different `*MethodCall()`. What I'm trying to do is something like this :

```
public void MethodOne(Func<> MethodCall)
{
//some stuff

*MethodCall;

//some stuff

}

```

but the Methods that are called each have a different return type and different parameters. Is there a way to do this using Functors? If not, how would I go about doing this?

Thank you!

Answer: 
You best bet would be to use the non-generic `Action` type (or `MethodInvoker` would be the same), i.e.

```
public void MethodOne(Action callback)
{
    //some stuff

    if(callback != null) callback();

    //some stuff
}

```

From this you can call any method by wrapping it at the caller, i.e.

```
MethodOne(SimpleMethod); // SimpleMethod has no parameters and returns void
MethodOne(() => MoreComplexMethod(1, "abc")); // this one returns void
MethodOne(() => { MethodThatReturnsSomething(12); }); // anything you like

```

etc
Every delegate in .Net is an instance of a class derived from [Delegate](http://msdn.microsoft.com/en-us/library/y22acf51.aspx). So if you really wish to pass 'any' delegate to a method, you can pass it as `Delegate`

To invoke it, you need to use its [DynamicInvoke](http://msdn.microsoft.com/en-us/library/system.delegate.dynamicinvoke.aspx) method.

```
public void MethodOne(Delegate MethodCall)
{
//some stuff

//Assuming you now have the required parameters
//or add params object[] args to the signature of this method
object res = MethodCall.DynamicInvoke(args); //args is object[] representing the parameters

//some stuff
}

```

But this is not recommended as `DynamicInvoke` is slow and it does not offer any compile time safety. Probably you should revisit your design.