I just came across the \"Hole in the Middle\" pattern and think that I can use it to remove some repetitive code specially when I try to benchmark different methods and
You can make a generic method and use a generic delegate:
public static TResult PrePostMethod<T1, T2, TResult>(Func<T1, T2, TResult> someMethod, T1 a, T2 b)
{
Debug.Print("Pre");
var result = someMethod(a, b);
Debug.Print("Post");
return result;
}
You'll need a separate generic overload for each number of parameters.