private static int NumberOfParameters(MethodInfo target) { Contract.Requires<ArgumentNullException>(target != null, "The target cannot be null."); return target.GetParameters().Count(); }