Before:
public static class Calculator
{
public static int Add(
int numberOne,
int numberTwo,
int numberThree,
int numberFour,
int numberFive)
{
return numberOne +
numberTwo +
numberThree +
numberFour +
numberFive;
}
}
...
MethodInfo boo =
typeof(Calculator).GetMethod("Add", new[]
{
typeof(int),
typeof(int),
typeof(int),
typeof(int),
typeof(int)
});
After:
public static class Calculator
{
public static int Add(
int numberOne,
int numberTwo,
int numberThree,
int numberFour,
int numberFive)
{
return numberOne +
numberTwo +
numberThree +
numberFour +
numberFive;
}
}
...
MethodInfo actual =
Reflect.Method(() => Calculator.Add(0, 0, 0, 0, 0));