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: 
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.
This is basically not possible. You could make `MethodOne` generic for the return type, and use a lambda that closes over its outside block instead of parameters:

```
static void Main(string[] args)
{
    int parameterSubst = 1;
    int result = MethodOne<int>(() => parameterSubst);
    string result2 = MethodOne<string>(() =>
    {
        string s = parameterSubst.ToString();
        s += "foo";
        return s;
    });
}

static T MethodOne<T>(Func<T> function)
{
    return function();
}

```

As you can see, `parameterSubst` is used in the passed `Func<T>`s, but not as a parameter.