Given the following code:
int result = Execute(() => Foo(1, 2));
public int Foo(int x, int y)
{
return x + y;
}
public T Execute<T>(
Func<T> function)
{
Console.Write(function.Method.Name + ": " + string.Join(", ", params));
return function();
}
Is it possible to get the parameters? So the output would read something like:
"Foo: 1, 2"
Aucun commentaire:
Enregistrer un commentaire